-
Notifications
You must be signed in to change notification settings - Fork 45.9k
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
ImportError: No module named nets, r0.12 #729
Comments
@michaelisard I posted the here because of no response of #6211 . Yet no response, closed both issues. (Y) |
I left this one open but haven't had a chance to respond yet. |
OK. I hope I get response asap. |
I'm not encountering this problem with python 2.7. in ± python -c "from nets import cifarnet; mynet = cifarnet.cifarnet"
I tensorflow/stream_executor/dso_loader.cc:128] successfully opened CUDA library libcublas.so.8.0 locally
I tensorflow/stream_executor/dso_loader.cc:128] successfully opened CUDA library libcudnn.so.5 locally
I tensorflow/stream_executor/dso_loader.cc:128] successfully opened CUDA library libcufft.so.8.0 locally
I tensorflow/stream_executor/dso_loader.cc:128] successfully opened CUDA library libcuda.so.1 locally
I tensorflow/stream_executor/dso_loader.cc:128] successfully opened CUDA library libcurand.so.8.0 locally Though I do encounter the following, I expect it can be fixed with some python path configuration: ~/src/tf_models/slim on master
± python nets/resnet_v2_test.py
I tensorflow/stream_executor/dso_loader.cc:128] successfully opened CUDA library libcublas.so.8.0 locally
I tensorflow/stream_executor/dso_loader.cc:128] successfully opened CUDA library libcudnn.so.5 locally
I tensorflow/stream_executor/dso_loader.cc:128] successfully opened CUDA library libcufft.so.8.0 locally
I tensorflow/stream_executor/dso_loader.cc:128] successfully opened CUDA library libcuda.so.1 locally
I tensorflow/stream_executor/dso_loader.cc:128] successfully opened CUDA library libcurand.so.8.0 locally
Traceback (most recent call last):
File "nets/resnet_v2_test.py", line 24, in <module>
from nets import resnet_utils
ImportError: No module named nets
-> [1] |
@adarob Running I don't know the reason why this isn't working. |
you solve this problem?, i got the same issue |
No, I have found no solution. |
@sguada Any updates? With latest version installation, I am still getting the error. |
If you understand the relative import and absolut import of python, then you will understand why |
@CodeLoverr Here is your solution tried and tested . Just add slim path to your PYTHONPATH in bashrc file And it works!! |
@anuj2rock This solution works for me! |
BTW it's not worked on Github. |
Hello, When I try your solution I have : export nis not recognized ... export PYTHONPATH="$PYTHONPATH:/... is ok for windows ? Sorry, it might be a stupid question.. I am new in python.. |
@Madekwe You can try manually adding the path to system variables. In Control Panel, look for "Edit the system environment variables", then "Environment Variables..." and add append your desired path to the end of "Path" variable. Hope it helps! |
The error is accruing because nets is not a module. It is a folder that contains different modules. Instead of writing |
Automatically closing due to lack of recent activity. Please update the issue when new information becomes available, and we will reopen the issue. Thanks! |
Can someone provide a proper solution for windows? |
same issue for mac OS, I am using pip3 PyCharm with Python 3.6. |
I had a lot of trouble with this too on Windows even after updating the PYTHONPATH. I found a brute force solution. For all files where they use "from nets import...", I switched it too "from slim.nets import ..." This requires going through a couple dozen files and updating, takes about 20 minutes max. Hopefully this is useful to someone! |
@burtonw0814 it works, thx |
@burtonw0814 It doesn't work for me: I still have an issue saying: |
@ljmouline Perhaps you could try specifying even more context: "from rest.of.path.slim.nets import..." |
I am trying to run
resnet_v2.py
from provided modles but getting errorImportError: No module named nets.
I have done following
First installing slim
cd $HOME/tensorflow git clone https://github.com/tensorflow/models/
To verify that this has worked, execute the following commands; it should run
without raising any errors.
cd $HOME/tensorflow/models/slim python3 -c "from nets import cifarnet; mynet = cifarnet.cifarnet"
I got no error.
But when I run following gives error "ImportError: No module named nets". I have also tried
cd $HOME/tensorflow/models/slim/ python3 -c "from nets import resnet_utils"
Got not error. Also build using bazel build nets output INFO: Found 1 target... Target //slim:nets up-to-date (nothing to build) INFO: Elapsed time: 0.096s, Critical Path: 0.00s
Same thing happen when try to run Inception with error
ImportError: No module named inception
I don't know why this is not working.
The text was updated successfully, but these errors were encountered: