Deeplabcut: Issue with Step 5 Training network on CPU (Accessing the "right" python)

Created on 8 Aug 2018  路  16Comments  路  Source: DeepLabCut/DeepLabCut

Using Windows 10, I installed TensorFLow and then DeepLabCut via "simplified installation with conda environments for a CPU". In trying to run through the demo, I got through Step4 just fine, however when I try to train the network I get the following error:
python: can't open file 'TF_CUDNN_USE_AUTOTUNE=0': [Errno 2] No such file or directory
I'm not sure what is going wrong (I am a beginner with python). I am not using an NVIDIA graphics card, but I don't know if my problem is related to this or not.

All 16 comments

This is strange, are you running TF_CUDNN_USE_AUTOTUNE=0 python3 ../../../train.py in the appropriate folder? I.e. pose-tensorflow/models/yourprojectname/train

Yes, I am in the folder \pose-tensorflow\models\reachingJan30-trainset95shuffle1\train (I am trying to run the demo). I tried dropping the 0 from 'TF_CUDNN_USE_AUTOTUNE=0' and got the same error. It may be possible that I downloaded the weights for ResNet pretrained on ImageNet incorrectly. I was unable to download them by using the command in the demo instructions, so I downloaded them manually and pasted the unzipped files ('resnet_v1_50.ckpt' & 'resnet_v1_101.ckpt') into the pose-tensorflow\models\pretrained folder. I don't know if this is related to the error message or not. Thanks!

Oh I see what you meant about dropping 'TF_CUDNN_USE_AUTOTUNE=0', sorry I misread this part of the comment initially. I dropped the whole prefix but I still get an error regarding 'train.py'

Can you please post the whole terminal output?

Traceback (most recent call last):
File "../../../train.py", line 4, in
import tensorflow as tf
ModuleNotFoundError: No module named 'tensorflow'

That suggests that your TensorFlow installation is not found. Did you install: https://github.com/AlexEMG/DeepLabCut/blob/master/dlcDependenciesFORWINDOWSwTF.yaml?

Yes, that is the one I installed.

Did the installation fail? If you open an ipython console (by typing ipython and then import tensorflow?, does it load it?). Perhaps you are not in the environment?

Yes, I think it seems to be loading it. I get a warning message but not an error message (FutureWarning: Conversion of the second argument of issubdtype from float to np.floating is deprecated. In future, it will be treated as np.float64 == np.dtype(float).type.
from ._conv import register_converters as _register_converters)

Are you using the same python? [for the ipython and python3 ../../../train.py command]?

I had the same issue. If you have multiple python installations, you must keep everything consistent or you may be missing dependencies. You can perform a simple check by typing the following into command prompt:

py --version
python --version
python3 -- version

If you want to use a specific version of python, it's recommend you either set an alias for that version or simply add the version after you type python. For example:

python3.6 train.py

Instead of

python3 train.py

The first method is specific to which python version you want to use. The second will use the default version of python 3 which may not be the one you intend on using as well as the one that has tensorflow installed.

Perhaps along the same lines, if you installed the yaml environment (with all the dependencies), be sure to activate it - once you installed the environment you can activate it, by typing on Linux/MacOS:

source activate DLCdependencies

and on Windows do:

activate DLCdependencies

Ok, thanks. I think I was entering some of the commands incorrectly, but I got the model to begin training, which it is in the process of completing. Hopefully I will not have any more issues. Thank you for your patience!

I have a similar issue, right away when starting the demo: "import deeplabcut " returns the error message:
import tensorflow as tf
ImportError: No module named 'tensorflow'

Tensorflow is correctly installed though, when typing import tensorflow as tf when I'm not in the DLCdependencies environment, there are no error messages at all.

Can you say which demo you are using? see the examples folder for lots of options...

I haven't really started yet, the error message comes up when trying to execute the first step of option 2, before even creating a new project: https://github.com/AlexEMG/DeepLabCut/blob/master/docs/UseOverviewGuide.md

you need to enter the environment then install tensorflow inside the environment.... see this demo video:https://www.youtube.com/watch?v=7xwOhUcIGio . You don't need to be inside any specific deeplabcut folder, but you do need to be inside the env. I recommend making a new environment, then installing the latest repo and TF for cpu use to test things... https://github.com/AlexEMG/DeepLabCut/blob/master/docs/installation.md

Was this page helpful?
0 / 5 - 0 ratings