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

erro in nodelet_imagenet.cpp #107

Open
ivory4u opened this issue Jul 4, 2022 · 5 comments
Open

erro in nodelet_imagenet.cpp #107

ivory4u opened this issue Jul 4, 2022 · 5 comments

Comments

@ivory4u
Copy link

ivory4u commented Jul 4, 2022

I just get below error.
How can I fix it?

[ 3%] Building CXX object ros_deep_learning/CMakeFiles/ros_deep_learning_nodelets.dir/src/nodelet_imagenet.cpp.o
/home/nvidia/catkin_ws/src/ros_deep_learning/src/nodelet_imagenet.cpp: In member function ‘void ros_deep_learning::ros_imagenet::callback(const ImageConstPtr&)’:
/home/nvidia/catkin_ws/src/ros_deep_learning/src/nodelet_imagenet.cpp:88:121: error: no matching function for call to ‘imageNet::Classify(imageConverter::PixelType*, uint32_t, uint32_t, float*)’
g_class = net->Classify(imgCvt->ImageGPU(), imgCvt->GetWidth(), imgCvt->GetHeight(), &confidence);
^
In file included from /home/nvidia/catkin_ws/src/ros_deep_learning/src/nodelet_imagenet.cpp:2:0:
/usr/local/include/jetson-inference/imageNet.h:154:6: note: candidate: int imageNet::Classify(float*, uint32_t, uint32_t, float*)
int Classify( float* rgba, uint32_t width, uint32_t height, float* confidence=NULL );
^
/usr/local/include/jetson-inference/imageNet.h:154:6: note: no known conversion for argument 1 from ‘imageConverter::PixelType* {aka uchar3*}’ to ‘float*’
/usr/local/include/jetson-inference/imageNet.h:162:6: note: candidate: int imageNet::Classify(float*)
int Classify( float* confidence=NULL );
^
/usr/local/include/jetson-inference/imageNet.h:162:6: note: candidate expects 1 argument, 4 provided
ros_deep_learning/CMakeFiles/ros_deep_learning_nodelets.dir/build.make:62: recipe for target 'ros_deep_learning/CMakeFiles/ros_deep_learning_nodelets.dir/src/nodelet_imagenet.cpp.o' failed
make[2]: *** [ros_deep_learning/CMakeFiles/ros_deep_learning_nodelets.dir/src/nodelet_imagenet.cpp.o] Error 1
CMakeFiles/Makefile2:3624: recipe for target 'ros_deep_learning/CMakeFiles/ros_deep_learning_nodelets.dir/all' failed
make[1]: *** [ros_deep_learning/CMakeFiles/ros_deep_learning_nodelets.dir/all] Error 2
Makefile:138: recipe for target 'all' failed
make: *** [all] Error 2

@dusty-nv
Copy link
Owner

dusty-nv commented Jul 4, 2022

Hi @ivory4u, I haven't been maintaining this nodelet, so I would just recommend commenting out lines 85-90 of CMakeLists.txt :

add_library(ros_deep_learning_nodelets src/nodelet_imagenet.cpp src/image_converter.cpp)

@ivory4u
Copy link
Author

ivory4u commented Jul 4, 2022

Hi @dusty-nv
I just comment out lines 85-90 of CMkaeLists.txt.
but I just get other issue like below.
Could help it?

CMakeFiles/video_source.dir/src/node_video_source.cpp.o: In function main': node_video_source.cpp:(.text+0x7cc): undefined reference to videoOptions::videoOptions()'
node_video_source.cpp:(.text+0xd40): undefined reference to videoOptions::CodecFromStr(char const*)' node_video_source.cpp:(.text+0xd6c): undefined reference to videoOptions::FlipMethodFromStr(char const*)'
node_video_source.cpp:(.text+0xee4): undefined reference to videoSource::Create(char const*, videoOptions const&)' CMakeFiles/video_source.dir/src/image_converter.cpp.o: In function imageConverter::Convert(boost::shared_ptr<sensor_msgs::Image_<std::allocator > const> const&)':
image_converter.cpp:(.text+0x924): undefined reference to cudaConvertColor(void*, imageFormat, void*, imageFormat, unsigned long, unsigned long, float2 const&)' CMakeFiles/video_source.dir/src/image_converter.cpp.o: In function imageConverter::Convert(sensor_msgs::Image_<std::allocator >&, imageFormat, uchar3*)':
image_converter.cpp:(.text+0xcc0): undefined reference to cudaConvertColor(void*, imageFormat, void*, imageFormat, unsigned long, unsigned long, float2 const&)' collect2: error: ld returned 1 exit status ros_deep_learning/CMakeFiles/video_source.dir/build.make:180: recipe for target '/home/nvidia/catkin_ws/devel/lib/ros_deep_learning/video_source' failed make[2]: *** [/home/nvidia/catkin_ws/devel/lib/ros_deep_learning/video_source] Error 1 CMakeFiles/Makefile2:3819: recipe for target 'ros_deep_learning/CMakeFiles/video_source.dir/all' failed make[1]: *** [ros_deep_learning/CMakeFiles/video_source.dir/all] Error 2 CMakeFiles/video_output.dir/src/node_video_output.cpp.o: In function main':
node_video_output.cpp:(.text+0x44c): undefined reference to videoOptions::videoOptions()' node_video_output.cpp:(.text+0x740): undefined reference to videoOptions::CodecFromStr(char const*)'
node_video_output.cpp:(.text+0x8a8): undefined reference to videoOutput::Create(char const*, videoOptions const&)' CMakeFiles/video_output.dir/src/image_converter.cpp.o: In function imageConverter::Convert(boost::shared_ptr<sensor_msgs::Image_<std::allocator > const> const&)':
image_converter.cpp:(.text+0x924): undefined reference to cudaConvertColor(void*, imageFormat, void*, imageFormat, unsigned long, unsigned long, float2 const&)' CMakeFiles/video_output.dir/src/image_converter.cpp.o: In function imageConverter::Convert(sensor_msgs::Image_<std::allocator >&, imageFormat, uchar3*)':
image_converter.cpp:(.text+0xcc0): undefined reference to `cudaConvertColor(void*, imageFormat, void*, imageFormat, unsigned long, unsigned long, float2 const&)'
collect2: error: ld returned 1 exit status
ros_deep_learning/CMakeFiles/video_output.dir/build.make:180: recipe for target '/home/nvidia/catkin_ws/devel/lib/ros_deep_learning/video_output' failed
make[2]: *** [/home/nvidia/catkin_ws/devel/lib/ros_deep_learning/video_output] Error 1
CMakeFiles/Makefile2:3750: recipe for target 'ros_deep_learning/CMakeFiles/video_output.dir/all' failed
make[1]: *** [ros_deep_learning/CMakeFiles/video_output.dir/all] Error 2
Makefile:138: recipe for target 'all' failed
make: *** [all] Error 2

@dusty-nv
Copy link
Owner

dusty-nv commented Jul 4, 2022

Hmm...can you try adding jetson-utils to this line:

target_link_libraries(video_source ${catkin_LIBRARIES} jetson-inference)

@ivory4u
Copy link
Author

ivory4u commented Jul 7, 2022

Hi @dusty-nv
Yes, It already added that line.

I use TX1 board and Kinetic of ros version.
Is it not working on Kinetic version?

@dusty-nv
Copy link
Owner

dusty-nv commented Jul 7, 2022

It's been a long time since I tested against Kinetic.

Can you also try adding jetson-utils to this line:

target_link_libraries(video_output ${catkin_LIBRARIES} jetson-inference)

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