Problems setting the RLagent from this: https://github.com/dusty-nv/jetson-reinforcement

During the “make” step in the instructions ( GitHub - dusty-nv/jetson-reinforcement: Deep reinforcement learning GPU libraries for NVIDIA Jetson TX1/TX2 with PyTorch, OpenAI Gym, and Gazebo robotics simulator.)

I get this error:

ubuntu@jetson-0420219087068:~/RoboND-DeepRL-Project/build$ make
[ 38%] Built target jetson-utils
[ 40%] Building CXX object CMakeFiles/jetson-reinforcement.dir/c/rlAgent.cpp.o
In file included from /home/ubuntu/RoboND-DeepRL-Project/c/rlAgent.cpp:6:0:
/home/ubuntu/RoboND-DeepRL-Project/c/pyTorch.h:14:19: fatal error: TH/TH.h: No such file or directory
compilation terminated.
CMakeFiles/jetson-reinforcement.dir/build.make:227: recipe for target ‘CMakeFiles/jetson-reinforcement.dir/c/rlAgent.cpp.o’ failed
make[2]: *** [CMakeFiles/jetson-reinforcement.dir/c/rlAgent.cpp.o] Error 1
CMakeFiles/Makefile2:67: recipe for target ‘CMakeFiles/jetson-reinforcement.dir/all’ failed
make[1]: *** [CMakeFiles/jetson-reinforcement.dir/all] Error 2
Makefile:83: recipe for target ‘all’ failed
make: *** [all] Error 2

It seems that there is a problem with pytorch? Can i just add the missing file TH/TH.h somewhere? Or should I re-install pytorch manually?

Hi,

Suppose you should get the header file installed when running cmake …/.

Do you meet any error when running the cmake command?
Or could you manually run the CMakePreBuild.sh again?
[url]https://github.com/dusty-nv/jetson-reinforcement/blob/master/CMakePreBuild.sh[/url]

Thanks.

Hi camransyed, note that this project should be running JetPack 3.3 if you are not using that.

Thanks Dusty. I am running Jetpack 3.3.1. It was the option available with the sdkManager

OK yes, that should be able to work. So if there isn’t TH/TH.h found, it probably means that PyTorch build didn’t succeed. Can you try manually running these steps from your jetson-reinforcement/build directory? You may want to rm -r -f build and start fresh.

# PyTorch v0.3 install script from CMakePreBuild.sh
	sudo apt-get install python-pip

	# upgrade pip
	pip --version
	pip install --upgrade pip==9.0.1
	pip --version	# pip 9.0.1 from /home/ubuntu/.local/lib/python2.7/site-packages (python 2.7)

	# lock OpenAI Gym before version 10 (breaking changes)
	sudo pip install gym==0.9.1

	# stuff for OpenAI Gym examples
	sudo apt-get install python-tk python-gi-cairo
	sudo apt-get install libfreetype6-dev	# needed by matplotlib

	sudo pip install matplotlib
	sudo pip install pyglet==1.3.1	# lock pyglet because we need to patch it

	sudo sed -i 's/_have_getprocaddress = True/_have_getprocaddress = False/' /usr/local/lib/python2.7/dist-packages/pyglet/gl/lib_glx.py

	# setproctitle extension used by A3G
	sudo pip install setproctitle 
	
	# install numpy
	sudo pip install numpy

	# see https://github.com/torch/cutorch/issues/797
	# use <= v0.2.0
	#export TORCH_NVCC_FLAGS="-D__CUDA_NO_HALF_OPERATORS__"
	echo $TORCH_NVCC_FLAGS 

	# clone pyTorch repo
	git clone https://github.com/pytorch/pytorch
	cd pytorch
	git tag
	git checkout v0.3.0 
	git branch
	git submodule update --init

	# install prereqs
	sudo pip install -U setuptools
	sudo pip install -r requirements.txt

	# Develop Mode:
	python setup.py build_deps
	sudo python setup.py develop

	cd torch
	ln -s _C.so lib_C.so
	cd lib
	ln -s libATen.so.1 libATen.so
	cd ../../

	git clone https://github.com/pytorch/examples
	sudo pip install -r examples/reinforcement_learning/requirements.txt 

	git clone -b v0.2.0 https://github.com/pytorch/vision
	cd vision
	sudo python setup.py install

	sudo apt-get install swig
	sudo pip install box2D