Closed dreinsdo closed 5 years ago
I was able to get openpose working on the TX1 with some changes to makefiles. A detailed writeup of my procedure, including how I prepped the TX1 is attached, along with the openpose files I edited. I would be happy to commit these to the repo. The procedure is also copied below.
Openpose TX1 install files.zip
This document describes the full procedure for installing openpose on the Jetson TX1. Other, and less involved, procedures may have been found successful by community members, and we encourage you to share your alternatives.
This procedure details moving the Jetson file system to a larger drive, building a custom kernel, building OpenCV from source, and customizing Openpose Makefiles because TX1 eMMC is limited, the onboard camera did not work with Openpose, stock Jetpack 3.1 OpenCV build lacks Openpose dependencies, and Openpose makefiles are not compatible with TX1 CUDA arch, respectively. We used a PS3 Eye camera in place of the onboard camera, and a 120Gb SSD, but most USB webcams and SATA drives should work fine.
This step is required because we were not able to use Openpose with the onboard TX1 camera. The steps are a combination of two JetsonHacks articles Build Kernel and ttyACM Module – NVIDIA Jetson TX1 and Sony PlayStation Eye – NVIDIA Jetson TX1. If you are using a different webcam then include the driver for that webcam in place of the PS3 eye driver in step 3.
$ cd buildJetsonTX1Kernel
$ sudo ./getKernelSources.sh
$ sudo ./makeKernel.sh
$ sudo cp /usr/src/kernel/kernel-4.4/arch/arm64/boot/Image ($PATH_TO_EMMC)/boot/Image
Replace $PATH_TO_EMMC with the path to your eMMC. This is required because the Jetson initially boots to eMMC and loads the kernel from their, even with the SATA drive connected.
Follow JK Jung's steps from How to Install OpenCV (3.4.0) on Jetson TX2 verbatim, with the following exception: omit installation of Python3 dependencies, i.e. skip the following lines.
$ sudo apt-get install python3-dev python3-pip python3-tk
$ sudo pip3 install numpy
$ sudo pip3 install matplotlib
The following steps detail the modification of three files to install Openpose. Modified versions of the files are attached and may alternatively be used. To use, be sure to rename both makefile configs to Makefile.config.Ubuntu16_cuda8_JetsonTX2
.
Clone from the master branch.
$ git clone https://github.com/CMU-Perceptual-Computing-Lab/openpose
$ cd openpose
Modify makefile config. For the installation procedure we will use the TX2 files for JetPack 3.1.
$ gedit scripts/ubuntu/Makefile.config.Ubuntu16_cuda8_JetsonTX2
Uncomment the opencv line
OPENCV_VERSION := 3
Replace all the 'CUDA_ARCH :=' lines with the following
CUDA_ARCH := -gencode arch=compute_53,code=[sm_53,compute_53]
Add CUDNN - not sure if this is necessary, have not retried the install without it.
USE_CUDNN := 1
Correct error in install script path.
$ gedit scripts/ubuntu/install_caffe_and_openpose_JetsonTX2_JetPack3.1.sh
Replace
executeShInItsFolder "install_openpose_JetsonTX2_JetPack3.1.sh" "./scripts/ubuntu/" "./"
with
executeShInItsFolder "./scripts/ubuntu/install_openpose_JetsonTX2_JetPack3.1.sh" "./" "./"
Start the install process. When you initially call the install script the caffe repo will be cloned and associated files downloaded. As soon as Caffe starts compiling, halt the process and change the makefile config as in step 2.
bash ./scripts/ubuntu/install_caffe_and_openpose_JetsonTX2_JetPack3.1.sh
Once caffe begins to compile CTRL+C
.
$ gedit 3rdparty/caffe/Makefile.config.Ubuntu16_cuda8_JetsonTX2
Make the same changes as in step 2. The CUDNN switch should already be on.
Restart the installation process.
bash ./scripts/ubuntu/install_caffe_and_openpose_JetsonTX2_JetPack3.1.sh
To get to decent FPS you need to lower the net resolution:
./build/examples/openpose/openpose.bin -camera_resolution 640x480 -net_resolution 128x96
To activate hand or face resolution please complete this command with the following options (warning, both simultaneously will cause out of memory error):
--hand -hand_net_resolution 256x256
--face -face_net_resolution 256x256
Thanks a lot! I added it in the last commit!
Issue Summary
I am on a Jetson TX1. I know this is not officially supported, however I am hoping someone can provide some insight. I am getting an error "'.build_release/examples/tests/clTest.bin' failed make".
I am on system config and what I've done:
I encounter this error when building openpose, cafffe builds without issues. Output:
OpenPose Output
CXX/LD -o .build_release/examples/tests/resizeTest.bin /usr/bin/ld: warning: libopencv_core.so.2.4, needed by 3rdparty/caffe/distribute/lib/libcaffe.so, not found (try using -rpath or -rpath-link) /usr/bin/ld: warning: libopencv_highgui.so.2.4, needed by 3rdparty/caffe/distribute/lib/libcaffe.so, not found (try using -rpath or -rpath-link) /usr/bin/ld: warning: libopencv_imgproc.so.2.4, needed by 3rdparty/caffe/distribute/lib/libcaffe.so, not found (try using -rpath or -rpath-link) .build_release/lib/libopenpose.so: undefined reference to, std::allocator > const&, cv::_InputArray const&)'
.buildrelease/lib/libopenpose.so: undefined reference to `cv::circle(cv::Mat&, cv::Point, int, cv::Scalar_ const&, int, int, int)'
.build_release/lib/libopenpose.so: undefined reference to , cv::_InputArray const&, bool)'
.build_release/lib/libopenpose.so: undefined reference to cxx11::basic_string<char, std::char_traits, std::allocator > const&, int, std::cxx11::basic_string<char, std::char_traits, std::allocator > const&)'
.build_release/lib/libopenpose.so: undefined reference to , std::allocator > const&)'
.build_release/lib/libopenpose.so: undefined reference to cxx11::basic_string<char, std::char_traits, std::allocator > const&)'
.build_release/lib/libopenpose.so: undefined reference to , std::allocator > const&)'
.build_release/lib/libopenpose.so: undefined reference to cxx11::basic_string<char, std::char_traits, std::allocator > const&, cv::_InputArray const&, std::vector<unsigned char, std::allocator >&, std::vector<int, std::allocator > const&)'
.build_release/lib/libopenpose.so: undefined reference to ::delete_obj()'
.build_release/lib/libopenpose.so: undefined reference to , std::allocator<cv::Rect > >&, double, int, int, cv::Size, cv::Size )'
.build_release/lib/libopenpose.so: undefined reference to , int, cv::TermCriteria, int, double)'
.build_release/lib/libopenpose.so: undefined reference to >&)'
.buildrelease/lib/libopenpose.so: undefined reference to `cv::line(cv::Mat&, cv::Point, cv::Point, cv::Scalar const&, int, int, int)'
.build_release/lib/libopenpose.so: undefined reference to , std::allocator > const&, int, double)'
.build_release/lib/libopenpose.so: undefined reference to cxx11::basic_string<char, std::char_traits, std::allocator > const&, int)'
.build_release/lib/libopenpose.so: undefined reference to , std::allocator > const&, int)'
collect2: error: ld returned 1 exit status
Makefile:492: recipe for target '.build_release/examples/tests/resizeTest.bin' failed
make: [.build_release/examples/tests/resizeTest.bin] Error 1
make: Waiting for unfinished jobs....
/usr/bin/ld: warning: libopencv_core.so.2.4, needed by 3rdparty/caffe/distribute/lib/libcaffe.so, not found (try using -rpath or -rpath-link)
/usr/bin/ld: warning: libopencv_highgui.so.2.4, needed by 3rdparty/caffe/distribute/lib/libcaffe.so, not found (try using -rpath or -rpath-link)
/usr/bin/ld: warning: libopencv_imgproc.so.2.4, needed by 3rdparty/caffe/distribute/lib/libcaffe.so, not found (try using -rpath or -rpath-link)
.build_release/lib/libopenpose.so: undefined reference to `cv::write(cv::FileStorage&, std:: cxx11::basic_string<char, std::char_traits, std::allocator > const&, cv::Mat const&)'
.build_release/lib/libopenpose.so: undefined reference to , int, cv::Scalar const&, int, int, int)'
.build_release/lib/libopenpose.so: undefined reference to , cv::_InputArray const&, bool)'
.build_release/lib/libopenpose.so: undefined reference to , std::allocator > const&, int, std:: cxx11::basic_string<char, std::char_traits, std::allocator > const&)'
.build_release/lib/libopenpose.so: undefined reference to , std::allocator > const&)'
.build_release/lib/libopenpose.so: undefined reference to cxx11::basic_string<char, std::char_traits, std::allocator > const&)'
.build_release/lib/libopenpose.so: undefined reference to , std::allocator > const&)'
.build_release/lib/libopenpose.so: undefined reference to cxx11::basic_string<char, std::char_traits, std::allocator > const&, int, int)'
.build_release/lib/libopenpose.so: undefined reference to > const&)'
.buildrelease/lib/libopenpose.so: undefined reference to `cv::CascadeClassifier::detectMultiScale(cv::Mat const&, std::vector<cv::Rect, std::allocator<cv::Rect > >&, double, int, int, cv::Size , cv::Size_)'
.build_release/lib/libopenpose.so: undefined reference to , int, cv::TermCriteria, int, double)'
.build_release/lib/libopenpose.so: undefined reference to >&)'
.buildrelease/lib/libopenpose.so: undefined reference to `cv::line(cv::Mat&, cv::Point, cv::Point, cv::Scalar const&, int, int, int)'
.build_release/lib/libopenpose.so: undefined reference to , std::allocator > const&, int, double)'
.build_release/lib/libopenpose.so: undefined reference to cxx11::basic_string<char, std::char_traits, std::allocator > const&, int)'
.build_release/lib/libopenpose.so: undefined reference to , std::allocator > const&, int)'
collect2: error: ld returned 1 exit status
Makefile:492: recipe for target '.build_release/examples/tests/clTest.bin' failed
make: *** [.build_release/examples/tests/clTest.bin] Error 1
cv::write(cv::FileStorage&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, cv::Mat const&)' .build_release/lib/libopenpose.so: undefined reference to
cv::imshow(std::cxx11::basic_string<char, std::char_traitscv::FileStorage::operator[](std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) const' .build_release/lib/libopenpose.so: undefined reference to
cv::_OutputArray::_OutputArray(cv::Mat&)' .build_release/lib/libopenpose.so: undefined reference tocv::VideoWriter::VideoWriter(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, int, double, cv::Size_<int>, bool)' .build_release/lib/libopenpose.so: undefined reference to
cv::drawChessboardCorners(cv::OutputArray const&, cv::Sizecv::Exception::Exception(int, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, int)' .build_release/lib/libopenpose.so: undefined reference to
cv::FileStorage::FileStorage(std::cv::imwrite(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, cv::_InputArray const&, std::vector<int, std::allocator<int> > const&)' .build_release/lib/libopenpose.so: undefined reference to
cv::operator<<(cv::FileStorage&, std::cxx11::basic_string<char, std::char_traitscv::_InputArray::_InputArray(cv::Mat const&)' .build_release/lib/libopenpose.so: undefined reference to
cv::VideoCapture::VideoCapture(std::cv::VideoCapture::get(int)' .build_release/lib/libopenpose.so: undefined reference to
cv::CascadeClassifier::load(std::__cxx11::basic_string<char, std::char_traitscv::cornerSubPix(cv::_InputArray const&, cv::_OutputArray const&, cv::Size_<int>, cv::Size_<int>, cv::TermCriteria)' .build_release/lib/libopenpose.so: undefined reference to
vtable for cv::_OutputArray' 3rdparty/caffe/distribute/lib/libcaffe.so: undefined reference to `cv::imencode(std::cv::_InputArray::_InputArray(double const&)' .build_release/lib/libopenpose.so: undefined reference to
vtable for cv::_InputArray' .build_release/lib/libopenpose.so: undefined reference tocv::resizeWindow(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, int, int)' .build_release/lib/libopenpose.so: undefined reference to
cv::Ptrcv::_InputArray::_InputArray(std::vector<cv::Mat, std::allocator<cv::Mat> > const&)' .build_release/lib/libopenpose.so: undefined reference to
cv::CascadeClassifier::detectMultiScale(cv::Mat const&, std::vector<cv::Rectcv::putText(cv::Mat&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, cv::Point_<int>, int, double, cv::Scalar_<double>, int, int, bool)' .build_release/lib/libopenpose.so: undefined reference to
cv::calcOpticalFlowPyrLK(cv::_InputArray const&, cv::_InputArray const&, cv::_InputArray const&, cv::_OutputArray const&, cv::_OutputArray const&, cv::OutputArray const&, cv::Sizecv::Ptr<CvVideoWriter>::delete_obj()' .build_release/lib/libopenpose.so: undefined reference to
cv::_OutputArray::_OutputArray(std::vector<cv::Mat, std::allocatorcv::getTextSize(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, int, double, int, int*)' .build_release/lib/libopenpose.so: undefined reference to
cv::setWindowProperty(std::cxx11::basic_string<char, std::char_traitscv::Formatter::get(char const*)' .build_release/lib/libopenpose.so: undefined reference to
cv::namedWindow(std::cv::calibrateCamera(cv::_InputArray const&, cv::_InputArray const&, cv::Size_<int>, cv::_OutputArray const&, cv::_OutputArray const&, cv::_OutputArray const&, cv::_OutputArray const&, int, cv::TermCriteria)' .build_release/lib/libopenpose.so: undefined reference to
cv::imread(std::cxx11::basic_string<char, std::char_traitscv::imshow(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, cv::_InputArray const&)' .build_release/lib/libopenpose.so: undefined reference to
cv::circle(cv::Mat&, cv::Pointcv::FileStorage::operator[](std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) const' .build_release/lib/libopenpose.so: undefined reference to
cv::_OutputArray::_OutputArray(cv::Mat&)' .build_release/lib/libopenpose.so: undefined reference tocv::VideoWriter::VideoWriter(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, int, double, cv::Size_<int>, bool)' .build_release/lib/libopenpose.so: undefined reference to
cv::drawChessboardCorners(cv::OutputArray const&, cv::Sizecv::Exception::Exception(int, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, int)' .build_release/lib/libopenpose.so: undefined reference to
cv::FileStorage::FileStorage(std::cxx11::basic_string<char, std::char_traitscv::imwrite(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, cv::_InputArray const&, std::vector<int, std::allocator<int> > const&)' .build_release/lib/libopenpose.so: undefined reference to
cv::operator<<(cv::FileStorage&, std::cxx11::basic_string<char, std::char_traitscv::_InputArray::_InputArray(cv::Mat const&)' .build_release/lib/libopenpose.so: undefined reference to
cv::VideoCapture::VideoCapture(std::cv::VideoCapture::get(int)' .build_release/lib/libopenpose.so: undefined reference to
cv::CascadeClassifier::load(std::cxx11::basic_string<char, std::char_traitscv::cornerSubPix(cv::_InputArray const&, cv::_OutputArray const&, cv::Size_<int>, cv::Size_<int>, cv::TermCriteria)' .build_release/lib/libopenpose.so: undefined reference to
vtable for cv::_OutputArray' 3rdparty/caffe/distribute/lib/libcaffe.so: undefined reference tocv::imencode(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, cv::_InputArray const&, std::vector<unsigned char, std::allocator<unsigned char> >&, std::vector<int, std::allocator<int> > const&)' .build_release/lib/libopenpose.so: undefined reference to
cv::_InputArray::_InputArray(double const&)' .build_release/lib/libopenpose.so: undefined reference tovtable for cv::_InputArray' .build_release/lib/libopenpose.so: undefined reference to
cv::resizeWindow(std::cv::Ptr<CvCapture>::delete_obj()' .build_release/lib/libopenpose.so: undefined reference to
cv::_InputArray::_InputArray(std::vector<cv::Mat, std::allocatorcv::putText(cv::Mat&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, cv::Point_<int>, int, double, cv::Scalar_<double>, int, int, bool)' .build_release/lib/libopenpose.so: undefined reference to
cv::calcOpticalFlowPyrLK(cv::_InputArray const&, cv::_InputArray const&, cv::_InputArray const&, cv::_OutputArray const&, cv::_OutputArray const&, cv::OutputArray const&, cv::Sizecv::Ptr<CvVideoWriter>::delete_obj()' .build_release/lib/libopenpose.so: undefined reference to
cv::_OutputArray::_OutputArray(std::vector<cv::Mat, std::allocatorcv::getTextSize(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, int, double, int, int*)' .build_release/lib/libopenpose.so: undefined reference to
cv::setWindowProperty(std::cxx11::basic_string<char, std::char_traitscv::Formatter::get(char const*)' .build_release/lib/libopenpose.so: undefined reference to
cv::namedWindow(std::cv::calibrateCamera(cv::_InputArray const&, cv::_InputArray const&, cv::Size_<int>, cv::_OutputArray const&, cv::_OutputArray const&, cv::_OutputArray const&, cv::_OutputArray const&, int, cv::TermCriteria)' .build_release/lib/libopenpose.so: undefined reference to
cv::imread(std::__cxx11::basic_string<char, std::char_traitsErrors detected. Exiting script. The software might have not been successfully installed.