-
Notifications
You must be signed in to change notification settings - Fork 282
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
Image Analogies not Importing theano_backend from Keras Correctly #31
Comments
I think I've seen this before...if I had to guess, theano isn't fully compiled properly. Are you running this inside a virtualenv? |
No, I've done the theano compilation on my own rather than through virtualenv. When I use Keras to drive the theano backend it works just fine I think. Which error were you seeing when you'd seen this before? The 1st or the second? I'm not convinced that they have the same root issue. |
I fixed this by just removing the bit of code since it was for cpu mode anyway. |
The only reason I'm going to all this effort to do this on my windows instead of my mac is because I want CUDA |
There should be one or two more errors after this, tell me what they are when you get them, I had the same problems so I just made a couple rushed temporary fixes and it was up and running. |
I'll try that, thanks! |
qazxswedcxzaqws I'm getting a new error like you expected. Here is everything I get from the call to the output:
|
Alllllll righty it's working so far! |
Well I'm getting output now on it but it doesn't seem to be utilizing much of my GPU. My CPU is maxing out and it's hitting 8gb or RAM but my GPU is idling and never reaches more than 1% load according to GPU-Z This means the iterations are taking forever. It does appear to be using all the memory though, hitting 3686MB |
That means the program is running in CPU mode, but from what you have posted it looks like it should be running in GPU mode. Mind posting what your output looks like when you run it now? |
Well I'm seeing the warning message that I wrote in while doing the first change saying Theano cuda without cuDNN detected.
But part of reading that says that CNMeM and cuDNN are there... It looks like it's using the GPU memory but not the cores for processing. |
Just double check that the changes I made earlier are 100% identical and also that cudNN is installed correctly, since i'm running an identical version without any ("Theano cuda without cuDNN detected. Forcing a-scale-mode to "match"") messages. |
Might be something with cuDNN. The code is identical. You're seeing cuDNN 4007 too? |
Actually I just found that some options I was using made the "theano cuda without cuDNN" message disappear, with a similar usage to yours I still get the message. But my GPU is being used properly still nonetheless, so its not really an issue for me. I'm running CUDA 8.0 and cuDNN 5005 since I have a Pascal GPU, but that shouldn't really be an issue as your CUDA version is probably more compatible than mine since it is older. |
kk looks like cuDNN is only available as 5xxx series now from NVIDIA so I'm gonna have to work on this. Might as well leave the cpu version running over night in the meantime. |
After getting and replacing the cuDNN (It's at 5103 now) it's showing the same low gpu load. Occasionally I'll see a 40~ish spike but mainly not running. Memory usage is still high. |
Strange, all I can do now is recommend this guide https://github.com/titu1994/Neural-Style-Transfer/blob/master/Guide.md in the "Setting Up Theano for GPU (on Windows)" Section, just in case you are missing any dependencies. As there don't seem to be any more error codes i'm not really sure whats going wrong, the only thing I can chalk it up to is this program is quite flaky and outdated in comparison to some newer Theano based alternatives. |
Hey the initial issue looks like you were using keras >= 1.0 with this project which was originally only compatible with keras 0.3. I've upgraded this project to use keras >= 1.0 so that should fix the get_output, and _on_gpu errors. The GPU usage issue can be a combination of things. The output you posted above
means the patch matching is done with a different algorithm on the CPU. Use the option There was another issue with some combination of keras/theano/whatever where the brute-force GPU patch-matching convolutions are "optimized" by theano to use the CPU, instead. I've added a fix to explicitly use the cuDNN operations. |
Here's the error output from running just a basic make image with image-analogies:
Using gpu device 0: GeForce GTX 970 (CNMeM is enabled with initial size: 75.0% of memory, cuDNN 4007)
Traceback (most recent call last):
File "make_image_analogy.py", line 17, in <module>
args = image_analogy.argparser.parse_args()
File "build\bdist.win-amd64\egg\image_analogy\argparser.py", line 101, in parse_args
AttributeError: 'module' object has no attribute '_on_gpu'
I'm able to run a full 12 epoch keras 1.0.5 test on the theano backend without problems. I've tried adding a "--a-scale-mode match" which gets me past the strange module issue but it just crashes on the first pass with an attribute error of
Convolution2D has no attribute 'get_output'
Not really sure what is going on.
The text was updated successfully, but these errors were encountered: