Evolving-AI-Lab / ppgn

Code for paper "Plug and Play Generative Networks"
MIT License
540 stars 102 forks source link

Errors in running first example code #4

Closed thommiano closed 7 years ago

thommiano commented 7 years ago

When I run sh 1_class_conditional_sampling.sh 13 I get the following error.

WARNING: Logging before InitGoogleLogging() is written to STDERR
F0105 05:49:58.930766   529 common.cpp:157] Check failed: error == cudaSuccess (10 vs. 0)  invalid device ordinal
*** Check failure stack trace: ***
Aborted (core dumped)
ls: cannot access output/fc8_chain_13_eps1_1e-5_eps3_1e-17/samples/*.jpg: No such file or directory
montage.im6: missing an image filename `output/fc8_chain_13_eps1_1e-5_eps3_1e-17/chain_13_hx_1e-5_noise_1e-17__{0..0}.jpg' @ error/montage.c/MontageImageCommand/1790.
/root/caffe/ppgn/output/fc8_chain_13_eps1_1e-5_eps3_1e-17/chain_13_hx_1e-5_noise_1e-17__{0..0}.jpg

I believe I've properly set the path for caffe/python in the settings.py file, but changing the path makes no impact as I continue to get the same error.

I'm using 8.0, V8.0.44 and Driver Version: 375.26, which should be compatible.

When I change the settings.py to gpu = False, I get the following error:

usage: sampling_class.py [-h] [--units units] [--n_iters iter]
                         [--threshold [w]] [--save_every save_iter]
                         [--reset_every reset_iter] [--lr [lr]]
                         [--lr_end [lr]] [--epsilon2 [lr]] [--epsilon1 [lr]]
                         [--epsilon3 [lr]] [--seed [n]] [--xy [n]]
                         [--opt_layer s] [--act_layer s] [--init_file s]
                         [--write_labels] [--output_dir b] [--net_weights b]
                         [--net_definition b]
sampling_class.py: error: argument --seed: invalid int value: '{0..0}'
ls: cannot access output/fc8_chain_13_eps1_1e-5_eps3_1e-17/samples/*.jpg: No such file or directory
montage.im6: missing an image filename `output/fc8_chain_13_eps1_1e-5_eps3_1e-17/chain_13_hx_1e-5_noise_1e-17__{0..0}.jpg' @ error/montage.c/MontageImageCommand/1790.
/root/caffe/ppgn/output/fc8_chain_13_eps1_1e-5_eps3_1e-17/chain_13_hx_1e-5_noise_1e-17__{0..0}.jpg

Looking through this directory, I found that the samples folder is empty: output/fc8_chain_13_eps1_1e-5_eps3_1e-17/samples/

Any thoughts? Any tips for finding the failure stack trace? Thanks!

anguyen8 commented 7 years ago

@thommiano : I suspect there is an issue with your Caffe. Does this Caffe work for you in other applications (e.g. classifying images)?

If yes, can you report the error when running ipython --pdb -- sampling_class.py instead of currently python sampling_class.py?

jakeelwes commented 7 years ago

I'm getting the same error - with ipython --pdb -- sampling_class.py I got Check failed: error == cudaSuccess (10 vs. 0) invalid device ordinal

So setting caffe.set_device(1) in sampling_class.py to caffe.set_device(0) fixed it for me (as I have 1 GPU)

thommiano commented 7 years ago

@jakeelwes Thanks for the recommendation! @anguyen8

What ended up working for me was correctly setting the file path and then using ./1_class_conditional_sampling.sh 13 rather than sh 1_class_conditional_sampling.sh 13. In my sampling_class.py file, it is currently commented out as #caffe.set_device(1).