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

network.py error #14

Closed
beckw opened this issue Oct 25, 2016 · 16 comments
Closed

network.py error #14

beckw opened this issue Oct 25, 2016 · 16 comments

Comments

@beckw
Copy link

beckw commented Oct 25, 2016

Hi there !
I've downloaded your Neural-Style_Transfer,and try to transfer some pictures. but got an error while computing.
could you help to take a look, thanks a lot.
capture

@titu1994
Copy link
Owner

titu1994 commented Oct 25, 2016

If you're in Windows, its easier to use the Script Helper program. It's in the releases tab, or in the script_helper folder if you downloaded the entire repo.

It ensures correct syntax in executing the script and makes it much easier to perform style transfers.

@titu1994
Copy link
Owner

titu1994 commented Oct 25, 2016

As to the error, its caused by "D:/test". You have to provide a prefix of the image:

So if D:/test is your test image directory, you need to provide the final path as "D:/test/temp1_"

@beckw
Copy link
Author

beckw commented Oct 25, 2016

I would like to use the Script Helper, and have tried it. it also doesn't work to me. I saw the command window start to using Theano and load model then the window disappeared. but i got a screen shot when it's going off.
capture02
capture3
did i make a mistake while setup Environment?

@titu1994
Copy link
Owner

titu1994 commented Oct 25, 2016

@beckw Try doing this : pip install --upgrade git+https://github.com/Theano/Theano.git

That will install and upgrade theano from github to the latest version. Also, your error from before is fixed. This is a new error caused by either an old theano version or using Theano with CPU mode without BLAS libraries.

Edit:
If such an error occurs, it is simpler to use the "Copy Arguments to Clipboard" button, which you can then paste into the cmd to see the error. Then you can paste the errors.

Example after copying the command arguments:
python network.py <-- paste here and just execute -->. It will show a long line of many arguments but that is fine.

@beckw
Copy link
Author

beckw commented Oct 26, 2016

@titu1994 I've used the command line to upgraded Theano to 0.90, still get the error:
capture4
FYI,I got some difference between your guide when I was installing cuDNN. I didn't see the sub-folder"cuda" into the CUDA directory after install CUDA7.5. So, when I extract cuDNN into the CUDA directory, it did not overwrite any files.
Is that a problem?
thanks

@titu1994
Copy link
Owner

@beckw I should have made the guide a bit clearer on that.

Once you extract the cudnn folder, there should be 3 sub folders inside the cuda folder. Copy those 3 sub folders and paste them in the CUDA 7.5 folder which has many folders.

It should then override the "bin", "lib" and "include" folders if I remember correctly. This activates cuDNN with CUDA

@beckw
Copy link
Author

beckw commented Oct 26, 2016

@titu1994 I actually did that and added system variables
CUDA_PATH = C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v7.5
CUDNN_PATH = C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v7.5
have no idea why still doesn't work?

@titu1994
Copy link
Owner

@beckw Did you write a .theanorc.txt file in your home directory with the given settings? In your earlier screenshot, it seems that Theano is still using your CPU.

When you use theano in GPU mode with cuDNN, it should show the a few startup lines like :

Using Theano backend
Using GPU device 0: GeForce GTX 980M (CNMEM is enabled with initial size: 80% of memory, cuDNN 5103)

You have to follow the final few steps to setup the .theanorc.txt in windows home directory : C:/Users/{Your Name}/

@beckw
Copy link
Author

beckw commented Oct 26, 2016

sorry, my fault! missing the first . when creating the .theanorc.txt
now it start using GPU.
but got another new error : (
capture5

@titu1994
Copy link
Owner

@beckw No problem. Do you have more than 1 CUDA installed ? As in CUDA 7.5 and 8 at the same time? This is usually caused then.

If not, then see if you overwrote the cuda files with the cudnn files.

@beckw
Copy link
Author

beckw commented Oct 27, 2016

@titu1994 I only have CUDA7.5 installed. and copied files like below:
The content of \cudnn-7.5-windows7-x64-v5.0-ga\cuda\bin To C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v7.5\bin
The content of \cudnn-7.5-windows7-x64-v5.0-ga\cuda\include To C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v7.5\include
The content of \cudnn-7.5-windows7-x64-v5.0-ga\cuda\lib\x64 To C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v7.5\lib\x64
Also add these two system variable follow your guide
capture06

@titu1994
Copy link
Owner

titu1994 commented Oct 27, 2016

@beckw
I made a mistake in the guide, the CUDNN_PATH must match the CUDA_PATH, since you are overwriting the files in CUDA. So try setting CUDNN_PATH to the CUDA_PATH.

If that still doesnt work, could you try editing the .theanorc.txt file to remove the line saying optimizer_including=cudnn?

This may be he problem. If it does run, make sure to check that when running the program it still gives the end part:

(CNMEM is enabled with initial size: 80% of memory, cuDNN 5103)

@beckw
Copy link
Author

beckw commented Oct 28, 2016

@titu1994 I've noticed that might be a mistake about CUDNN_PATH in the guide, so I already set both them same.
I have also tried to remove the line: optimizer_including=cudnn and add cudnn=1.0 at the bottom in the .theanorc.txt file.
It still saying (CNMeM is enabled with initial size: 80. 0% of memory, cuDNN not available)

@titu1994
Copy link
Owner

titu1994 commented Oct 28, 2016

@beckw Hmm I don't know what's causing this. For some reason Theano is not able to detect cuDNN. The flag optimizer_including=cudnn is to ensure that theano runs only with cudnn enabled, otherwise crash fast. The fact that Theano is saying cudnn not available means that it can't find cudnn inside cuda for some reason.

Btw, use cudnn=0.8 at max. Using 100 % of gpu memory usually crashes theano because it cannot allocate the memory required by Windows to render the screen.

In any case, cuDNN is needed mainly for the INetwork.py script, since it uses every single layer of the VGG 16 or 19 network which is computationally extremely expensive. You can use the Network.py script instead which uses only 5 layers out of the 16 or 19 to run the program, though quality will be reduced.

@beckw
Copy link
Author

beckw commented Oct 31, 2016

@titu1994 It works after reinstall CUDA and cuDNN.
Great thanks all your help!! : )

@titu1994
Copy link
Owner

@beckw No problem. Glad it finally worked.

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