nqanh/affordance-net

Error parsing text-format caffe.NetParameter

Closed this issue · 3 comments

Hi,
I installed and built pycaffe, but there was a error when I tried to run demo_img.py.
Do you know how I can solve the problem?

Thanks,

Error message:
[libprotobuf ERROR google/protobuf/text_format.cc:288] Error parsing text-format caffe.NetParameter: 490:23: Message type "caffe.LayerParameter" has no field named "roi_alignment_param".
F1111 19:04:30.259788 23639 upgrade_proto.cpp:88] Check failed: ReadProtoFromTextFile(param_file, param) Failed to parse NetParameter file: /home/mmvc/affordance-net/models/pascal_voc/VGG16/faster_rcnn_end2end/test.prototxt

nqanh commented

It seems that your Caffe version doen't have the RoI alignment layer. Did you clone and build caffe in our repo? (not the offical caffe version since it doesn't have the alignment layer). Also, check your PYTHONPATH, maybe you're calling a different Caffe version in your system.

If the problem persists, please post the full error message and your PYTHONPATH. Thanks!

hi, thanks for your reply. Yes I realized that I was using official caffe, so I am building caffe in your repo. But there is another error persists while building your caffe, the error message is:
CXX/LD -o .build_release/tools/compute_image_mean.bin
.build_release/lib/libcaffe.so: undefined reference to jas_image_writecmpt' .build_release/lib/libcaffe.so: undefined reference to png_create_info_struct'
.build_release/lib/libcaffe.so: undefined reference to half::_eLut' .build_release/lib/libcaffe.so: undefined reference to jpeg_resync_to_restart'
.build_release/lib/libcaffe.so: undefined reference to jas_cmprof_destroy' .build_release/lib/libcaffe.so: undefined reference to png_read_info'
.build_release/lib/libcaffe.so: undefined reference to png_write_info' .build_release/lib/libcaffe.so: undefined reference to tbb::internal::get_initial_auto_partitioner_divisor()'
.build_release/lib/libcaffe.so: undefined reference to Imf::Header::~Header()' .build_release/lib/libcaffe.so: undefined reference to png_set_strip_16'
.build_release/lib/libcaffe.so: undefined reference to Imf::hasChromaticities(Imf::Header const&)' .build_release/lib/libcaffe.so: undefined reference to TIFFReadRGBATile'
.build_release/lib/libcaffe.so: undefined reference to Imf::InputFile::readPixels(int, int)' .build_release/lib/libcaffe.so: undefined reference to Imf::OutputFile::setFrameBuffer(Imf::FrameBuffer const&)'
.build_release/lib/libcaffe.so: undefined reference to TIFFSetWarningHandler' .build_release/lib/libcaffe.so: undefined reference to jpeg_std_error'
.build_release/lib/libcaffe.so: undefined reference to jas_image_destroy' .build_release/lib/libcaffe.so: undefined reference to jpeg_CreateDecompress'
.build_release/lib/libcaffe.so: undefined reference to jpeg_start_compress' .build_release/lib/libcaffe.so: undefined reference to png_get_io_ptr'
.build_release/lib/libcaffe.so: undefined reference to TIFFSetField' .build_release/lib/libcaffe.so: undefined reference to png_set_expand_gray_1_2_4_to_8'
.build_release/lib/libcaffe.so: undefined reference to Imf::Header::Header(int, int, float, Imath::Vec2<float> const&, float, Imf::LineOrder, Imf::Compression)' .build_release/lib/libcaffe.so: undefined reference to png_set_swap'
.build_release/lib/libcaffe.so: undefined reference to jpeg_set_quality' .build_release/lib/libcaffe.so: undefined reference to png_set_read_fn'
.build_release/lib/libcaffe.so: undefined reference to jpeg_read_header' .build_release/lib/libcaffe.so: undefined reference to png_write_image'
.build_release/lib/libcaffe.so: undefined reference to png_destroy_read_struct' .build_release/lib/libcaffe.so: undefined reference to TIFFClose'
.build_release/lib/libcaffe.so: undefined reference to TIFFReadRGBAStrip' .build_release/lib/libcaffe.so: undefined reference to TIFFGetField'
.build_release/lib/libcaffe.so: undefined reference to jpeg_alloc_huff_table' .build_release/lib/libcaffe.so: undefined reference to tbb::task_scheduler_init::terminate()'
.build_release/lib/libcaffe.so: undefined reference to png_set_rgb_to_gray' .build_release/lib/libcaffe.so: undefined reference to png_set_IHDR'
.build_release/lib/libcaffe.so: undefined reference to typeinfo for tbb::task' .build_release/lib/libcaffe.so: undefined reference to tbb::internal::allocate_continuation_proxy::allocate(unsigned long) const'
.build_release/lib/libcaffe.so: undefined reference to jas_stream_close' .build_release/lib/libcaffe.so: undefined reference to png_destroy_write_struct'
.build_release/lib/libcaffe.so: undefined reference to tbb::task_group_context::is_group_execution_cancelled() const' .build_release/lib/libcaffe.so: undefined reference to jas_image_readcmpt'
.build_release/lib/libcaffe.so: undefined reference to jpeg_destroy_decompress' .build_release/lib/libcaffe.so: undefined reference to png_init_io'
.build_release/lib/libcaffe.so: undefined reference to png_create_read_struct' .build_release/lib/libcaffe.so: undefined reference to Imf::InputFile::setFrameBuffer(Imf::FrameBuffer const&)'
.build_release/lib/libcaffe.so: undefined reference to Imf::OutputFile::~OutputFile()' .build_release/lib/libcaffe.so: undefined reference to Imf::OutputFile::writePixels(int)'
.build_release/lib/libcaffe.so: undefined reference to tbb::internal::allocate_child_proxy::allocate(unsigned long) const' .build_release/lib/libcaffe.so: undefined reference to jpeg_stdio_dest'
.build_release/lib/libcaffe.so: undefined reference to png_get_tRNS' .build_release/lib/libcaffe.so: undefined reference to png_set_bgr'
.build_release/lib/libcaffe.so: undefined reference to TIFFReadEncodedTile' .build_release/lib/libcaffe.so: undefined reference to jas_image_encode'
.build_release/lib/libcaffe.so: undefined reference to jas_image_strtofmt' .build_release/lib/libcaffe.so: undefined reference to png_set_packing'
.build_release/lib/libcaffe.so: undefined reference to TIFFWriteScanline' .build_release/lib/libcaffe.so: undefined reference to jpeg_finish_compress'
.build_release/lib/libcaffe.so: undefined reference to Imf::globalThreadCount()' .build_release/lib/libcaffe.so: undefined reference to Imf::InputFile::InputFile(char const*, int)'
.build_release/lib/libcaffe.so: undefined reference to TIFFReadEncodedStrip' .build_release/lib/libcaffe.so: undefined reference to Imf::FrameBuffer::insert(char const*, Imf::Slice const&)'
.build_release/lib/libcaffe.so: undefined reference to png_set_strip_alpha' .build_release/lib/libcaffe.so: undefined reference to png_get_IHDR'
.build_release/lib/libcaffe.so: undefined reference to jas_image_decode' .build_release/lib/libcaffe.so: undefined reference to png_set_compression_level'
.build_release/lib/libcaffe.so: undefined reference to png_set_gray_to_rgb' .build_release/lib/libcaffe.so: undefined reference to vtable for tbb::task'
.build_release/lib/libcaffe.so: undefined reference to jas_stream_fopen' .build_release/lib/libcaffe.so: undefined reference to jpeg_destroy_compress'
.build_release/lib/libcaffe.so: undefined reference to TIFFIsTiled' .build_release/lib/libcaffe.so: undefined reference to glXGetProcAddressARB'
.build_release/lib/libcaffe.so: undefined reference to png_set_write_fn' .build_release/lib/libcaffe.so: undefined reference to jas_matrix_create'
.build_release/lib/libcaffe.so: undefined reference to jpeg_finish_decompress' .build_release/lib/libcaffe.so: undefined reference to jpeg_set_defaults'
.build_release/lib/libcaffe.so: undefined reference to tbb::task::note_affinity(unsigned short)' .build_release/lib/libcaffe.so: undefined reference to TIFFOpen'
.build_release/lib/libcaffe.so: undefined reference to png_write_end' .build_release/lib/libcaffe.so: undefined reference to Imf::Slice::Slice(Imf::PixelType, char*, unsigned long, unsigned long, int, int, double, bool, bool)'
.build_release/lib/libcaffe.so: undefined reference to TIFFSetErrorHandler' .build_release/lib/libcaffe.so: undefined reference to jpeg_start_decompress'
.build_release/lib/libcaffe.so: undefined reference to Imf::OutputFile::OutputFile(char const*, Imf::Header const&, int)' .build_release/lib/libcaffe.so: undefined reference to tbb::task_group_context::~task_group_context()'
.build_release/lib/libcaffe.so: undefined reference to Imf::InputFile::header() const' .build_release/lib/libcaffe.so: undefined reference to jas_init'
.build_release/lib/libcaffe.so: undefined reference to jas_image_getcmptbytype' .build_release/lib/libcaffe.so: undefined reference to png_read_end'
.build_release/lib/libcaffe.so: undefined reference to tbb::task_scheduler_init::initialize(int)' .build_release/lib/libcaffe.so: undefined reference to tbb::task_scheduler_init::initialize(int, unsigned long)'
.build_release/lib/libcaffe.so: undefined reference to png_read_image' .build_release/lib/libcaffe.so: undefined reference to jpeg_write_scanlines'
.build_release/lib/libcaffe.so: undefined reference to png_set_filter' .build_release/lib/libcaffe.so: undefined reference to tbb::task_group_context::init()'
.build_release/lib/libcaffe.so: undefined reference to png_create_write_struct' .build_release/lib/libcaffe.so: undefined reference to png_error'
.build_release/lib/libcaffe.so: undefined reference to png_read_update_info' .build_release/lib/libcaffe.so: undefined reference to Imf::Header::channels()'
.build_release/lib/libcaffe.so: undefined reference to jas_image_create' .build_release/lib/libcaffe.so: undefined reference to jas_cleanup'
.build_release/lib/libcaffe.so: undefined reference to TIFFRGBAImageOK' .build_release/lib/libcaffe.so: undefined reference to png_set_palette_to_rgb'
.build_release/lib/libcaffe.so: undefined reference to tbb::internal::allocate_root_with_context_proxy::free(tbb::task&) const' .build_release/lib/libcaffe.so: undefined reference to Imf::Header::dataWindow() const'
.build_release/lib/libcaffe.so: undefined reference to TIFFScanlineSize' .build_release/lib/libcaffe.so: undefined reference to jpeg_CreateCompress'
.build_release/lib/libcaffe.so: undefined reference to jas_matrix_destroy' .build_release/lib/libcaffe.so: undefined reference to png_set_interlace_handling'
.build_release/lib/libcaffe.so: undefined reference to jpeg_read_scanlines' .build_release/lib/libcaffe.so: undefined reference to tbb::task_scheduler_init::default_num_threads()'
.build_release/lib/libcaffe.so: undefined reference to Imf::ChannelList::insert(char const*, Imf::Channel const&)' .build_release/lib/libcaffe.so: undefined reference to jas_cmprof_createfromclrspc'
.build_release/lib/libcaffe.so: undefined reference to tbb::internal::allocate_root_with_context_proxy::allocate(unsigned long) const' .build_release/lib/libcaffe.so: undefined reference to half::convert(int)'
.build_release/lib/libcaffe.so: undefined reference to Imf::Header::channels() const' .build_release/lib/libcaffe.so: undefined reference to Imf::chromaticities(Imf::Header const&)'
.build_release/lib/libcaffe.so: undefined reference to Imf::ChannelList::findChannel(char const*) const' .build_release/lib/libcaffe.so: undefined reference to png_set_compression_strategy'
.build_release/lib/libcaffe.so: undefined reference to jpeg_stdio_src' .build_release/lib/libcaffe.so: undefined reference to jas_image_chclrspc'
.build_release/lib/libcaffe.so: undefined reference to Imf::Chromaticities::Chromaticities(Imath::Vec2<float> const&, Imath::Vec2<float> const&, Imath::Vec2<float> const&, Imath::Vec2<float> const&)' .build_release/lib/libcaffe.so: undefined reference to Imf::Channel::Channel(Imf::PixelType, int, int, bool)'
collect2: error: ld returned 1 exit status
make: *** [.build_release/tools/compute_image_mean.bin] Error 1
It seems like there is something wrong with compute_image_mean.bin? In fact I am really new to caffe and I am not sure where the problem is.

I solve the problem by using opencv2 instead of opencv3