adepierre / Caffe_BEGAN

Caffe/C++ implementation of Boundary Equilibrium Generative Adversarial Networks paper for face generation
MIT License
21 stars 16 forks source link

Unable to Run Caffe_BEGAN #2

Open govindshenoy opened 5 years ago

govindshenoy commented 5 years ago

Hi There!

I have done the following:

In the ROOT Directory I have ran "cmake ./". I get the following:

-- Configuring done -- Generating done -- Build files have been written to: /p/prometheus/private/govind2/Caffe_BEGAN.

When I run the test exec, I get the following error:

./launch_files/BEGAN_Generator_iter_325000.caffemodel: line 6: syntax error near unexpected token `)'
generator_ip1/BEGAN_Generator_iter_325000.caffemodel: line 6: InnerProduct
And it prints some random string. I tried running the train.bat file, I get the following error: ../bin/Release/Caffe_BEGAN.exe No such file or directory There is nothing in the bin directory. Am I missing something ? Regards Govind
adepierre commented 5 years ago

Hi,

After the CMake generation you need to actually build the executable. On which platform are you? On Windows with Visual Studio you need to open the .sln that should have been created and then build it from there. This should get you the executable file you need.

govindshenoy commented 5 years ago

Hi There!

I have installed Caffe_BEGAN though with some slight modifications. Mainly when linking I linked with -shared option to overcome the following error:

/usr/bin/ld: CMakeFiles/Caffe_BEGAN.dir/src/NN_Agent.cpp.o: undefined reference to symbol _ZN6google4base21CheckOpMessageBuilder7ForVar2Ev
//usr/lib/x86_64-linux-gnu/libglog.so.0: error adding symbols: DSO missing from command line

Now when I run Caffe_BEGAN it gives a segmentation fault. I tried compiling with -g option for the 2 files: main.cpp and NN_Agent.cpp but it does not dump the stack trace. Can you tell me how to proceed ?

Regards Govind

adepierre commented 5 years ago

I'm affraid I can't really help you with this one. Can you successfully build any other program linked with your caffe library?

My best guess would be that you are compiling with one version of a library (glog) but you are executing it with a non matching dynamic one. Maybe. Not sure. At all.

govindshenoy commented 5 years ago

Hi There!

How can I check the library compiled is same as the executing one. I modified LD_LIBRARY_PATH is that the way ?

Regards Govind

On Fri, 5 Apr 2019 at 18:10, adepierre notifications@github.com wrote:

I'm affraid I can't really help you with this one. Can you successfully build any other program linked with your caffe library?

My best guess would be that you are compiling with one version of a library (glog) but you are executing it with a non matching dynamic one. Maybe. Not sure. At all.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/adepierre/Caffe_BEGAN/issues/2#issuecomment-480448953, or mute the thread https://github.com/notifications/unsubscribe-auth/ADHK23QvyhHyuGcjHnFbC8urRPuoDJSbks5vd9fRgaJpZM4cbiFy .

adepierre commented 5 years ago

I'm sorry I don't know what LD_LIBRARY_PATH is.

govindshenoy commented 5 years ago

Hi There!

I got it finally not segfaulting. But I have run into a new error when I run train.bat:

F0409 17:29:42.990301 22760 solver_factory.hpp:76] Check failed: registry.count(type) == 1 (0 vs. 1) Unknown solver type: Adam (known types: ) Check failure stack trace: @ 0x55d575cfbe36 google::LogMessage::Fail() @ 0x55d575cfbd7f google::LogMessage::SendToLog() @ 0x55d575cfb6c1 google::LogMessage::Flush() @ 0x55d575cfef76 google::LogMessageFatal::~LogMessageFatal() @ 0x55d575c2ca89 caffe::SolverRegistry<>::CreateSolver() @ 0x55d575c298cb NN_Agent::NN_Agent() @ 0x55d575c38623 main @ 0x7f9e872bf09b __libc_start_main @ 0x55d575c295da _start @ (nil) (unknown) ./train.bat: line 1: 22760 Aborted (core dumped) "../bin/Caffe_BEGAN" --train=1 --weights_gen= --weights_discr= --z_dim=128 --h_dim=128 --hidden_dim=64 --image_size=128 --solver_gen=solver_generator.prototxt --solver_discr=solver_discriminator.prototxt --batch_size=16 --snapshot_generator= --snapshot_discriminator= --snapshot_k_t= --preview_generator=preview_values.csv --number_batch_loaded=125 --start_epoch=0 --end_epoch=25 --training_dataset=../Data/CelebA

Do you have any idea why it is spitting out that error ?

Regards Govind

On Sat, 6 Apr 2019 at 07:41, adepierre notifications@github.com wrote:

I'm sorry I don't know what LD_LIBRARY_PATH is.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/adepierre/Caffe_BEGAN/issues/2#issuecomment-480501064, or mute the thread https://github.com/notifications/unsubscribe-auth/ADHK29elB5E093Ew9UVkDo0VWY_7UZD0ks5veJXegaJpZM4cbiFy .

adepierre commented 5 years ago

Hi,

This issue is from Caffe. Your version has no solver included. I guess something went wrong during the compilation. Did you use the official github of Caffe (https://github.com/BVLC/caffe) ?

Have you already built anything else successfully with your caffe library ?

govindshenoy commented 5 years ago

Hi There!

I habe built using the official version of Caffe. I have not tried anything else. How do I include the solver ?

Regards Govind

On Tue, 9 Apr 2019 at 17:53, adepierre notifications@github.com wrote:

Hi,

This issue is from Caffe. Your version has no solver included. I guess something went wrong during the compilation. Did you use the official github of Caffe (https://github.com/BVLC/caffe) ?

Have you already built anything else successfully with your caffe library ?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/adepierre/Caffe_BEGAN/issues/2#issuecomment-481469503, or mute the thread https://github.com/notifications/unsubscribe-auth/ADHK258_arSVb2ZNdtdTVW5WfCo6n0Y6ks5vfRnlgaJpZM4cbiFy .

adepierre commented 5 years ago

Well, that's the strange thing, they should be generated when you compile caffe. You could try that and see if it works: https://github.com/BVLC/caffe/issues/4010#issuecomment-264746615

govindshenoy commented 5 years ago

Hi There!

I tried on Debian and I get the following error when I compile BEGAN:

/home/govind/Caffe_BEGAN/src/main.cpp: In function ‘void LoadImagesFromFiles(const std::vector<std::__cxx11::basic_string >&, std::vector, std::vector<std::vector >*, const int&)’: /home/govind/Caffe_BEGAN/src/main.cpp:65:83: error: ‘cv::InterpolationFlags’ has not been declared img_crop, img_crop, cv::Size(image_size, image_size), 0.0, 0.0, cv::InterpolationFlags::INTER_LINEAR)

adepierre commented 5 years ago

This is a problem with OpenCV this time. Which version do you have?

govindshenoy commented 5 years ago

Hi There!

I am having opencv version 2.4.9.1.

Regards Govind

On Mon, 15 Apr 2019 at 17:43, adepierre notifications@github.com wrote:

This is a problem with OpenCV this time. Which version do you have?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/adepierre/Caffe_BEGAN/issues/2#issuecomment-483445772, or mute the thread https://github.com/notifications/unsubscribe-auth/ADHK28-XV0T8OBrZRjHB-bjHUQOP-Rpwks5vhQCegaJpZM4cbiFy .

adepierre commented 5 years ago

Yep, I guess the flag did not exist in this old version. You can try to replace cv::InterpolationFlags::INTER_LINEAR with 1.