Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

demo.ipynb import issues #4

Open
IdoWSC opened this issue Jan 22, 2018 · 9 comments
Open

demo.ipynb import issues #4

IdoWSC opened this issue Jan 22, 2018 · 9 comments

Comments

@IdoWSC
Copy link

IdoWSC commented Jan 22, 2018

Hi,
I have a problem running the demo:
ImportError Traceback (most recent call last)
in ()
7
8 from hart.data import disp
----> 9 from hart.data.kitti.tools import get_data
10 from hart.model import util
11 from hart.model.attention_ops import FixedStdAttention

C:\Program Files\Anaconda3\Lib\site-packages\hart\hart\data\kitti\tools.py in ()
26 import tensorflow as tf
27
---> 28 import neurocity as nct
29 from neurocity.data import store
30 from neurocity.data import tools as data_tools

C:\Program Files\Anaconda3\Lib\site-packages\hart\neurocity_init_.py in ()
20 ########################################################################################
21
---> 22 from component.model.base import train_mode, test_mode, mode
23 from component import loss, layer
24 from component.model.model import Model

C:\Program Files\Anaconda3\Lib\site-packages\hart\neurocity\component_init_.py in ()
23
24 import tensorflow as tf
---> 25 from layer import Layer
26 from model.model import Model
27

C:\Program Files\Anaconda3\Lib\site-packages\hart\neurocity\component\layer.py in ()
26 import numpy as np
27
---> 28 from neurocity.component.model import base
29
30

C:\Program Files\Anaconda3\Lib\site-packages\hart\neurocity\component_init_.py in ()
23
24 import tensorflow as tf
---> 25 from layer import Layer
26 from model.model import Model
27

ImportError: cannot import name 'Layer'

@akosiorek
Copy link
Owner

The class Layer is defined in neurocity.component.layer (at https://github.com/akosiorek/hart/blob/master/neurocity/component/layer.py) I assume the error has to do with how environment variables are set on your system. Can you try adding the hart folder to your PYTHONPATH?

@IdoWSC
Copy link
Author

IdoWSC commented Jan 22, 2018 via email

@akosiorek
Copy link
Owner

akosiorek commented Jan 22, 2018

I have hart, neurocity, and component all added to PYTHONPATH

I have only hart in my PYTHONPATH; that might be the issue.

By the way, has the script ever run on Windows and/or Python3+?

I tested only on MacOS and Linux and Python 2.7

@IdoWSC IdoWSC closed this as completed Jan 23, 2018
@IdoWSC
Copy link
Author

IdoWSC commented Jan 24, 2018

I think I found the source of the issue.
File "C:\Program Files\Anaconda3\Lib\site-packages\hart\hart\model\attention_ops.py", line 28, in
from hart.model import tensor_ops
File "C:\Program Files\Anaconda3\Lib\site-packages\hart\hart\model\tensor_ops.py", line 23, in
from neurocity.tensor_ops import broadcast_against
File "C:\Program Files\Anaconda3\Lib\site-packages\hart\neurocity_init_.py", line 22, in
from component.model.base import train_mode, test_mode, mode
File "C:\Program Files\Anaconda3\Lib\site-packages\hart\neurocity\component_init_.py", line 25, in
from layer import Layer
File "C:\Program Files\Anaconda3\Lib\site-packages\hart\neurocity\component\layer.py", line 28, in
from neurocity.component.model import base
File "C:\Program Files\Anaconda3\Lib\site-packages\hart\neurocity\component_init_.py", line 25, in
from layer import Layer
ImportError: cannot import name 'Layer'

in hart\neurocity_init_.py there is an import from component.model.base which first runs component/init.py.

There there is an import from layer which runs component/model/init.py that calls for import from component.model.model base that is importing layer again that eventually imports base again and so on.

this infinite loop is whats causing this failure

@IdoWSC IdoWSC reopened this Jan 24, 2018
@IdoWSC
Copy link
Author

IdoWSC commented Jan 25, 2018

The source for the issue when using Python3.3+ can be found here:
import_traps

@IdoWSC
Copy link
Author

IdoWSC commented Jan 25, 2018

I have modified your package to comply with py3.3+ and tf1.3+ if it interests you guys contact me

@akosiorek
Copy link
Owner

Good job @IdoWSC. Sure, it'd be great to have. Would you like to submit a PR?

@ghost
Copy link

ghost commented Nov 21, 2018

I run demo.ipynb,but I do not found result picture.

@ghost
Copy link

ghost commented Nov 21, 2018

why not use plt.show()? I can not to show the picture.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants