GithubHelp home page GithubHelp logo

dusty-nv / jetson-reinforcement Goto Github PK

View Code? Open in Web Editor NEW
876.0 62.0 225.0 15.76 MB

Deep reinforcement learning GPU libraries for NVIDIA Jetson TX1/TX2 with PyTorch, OpenAI Gym, and Gazebo robotics simulator.

License: MIT License

CMake 2.86% Shell 4.93% C++ 31.93% C 1.50% Lua 24.69% Python 19.12% Cuda 1.32% Jupyter Notebook 13.64%

jetson-reinforcement's Introduction

Deep Reinforcement Learning in Robotics

note: this repo supports PyTorch v0.3 and JetPack 3.2. For newer examples, check out:
          - openai_ros package
          - gym_gazebo2 repo
          - Isaac SDK samples

In this tutorial, we'll be creating artificially intelligent agents that learn from interacting with their environment, gathering experience, and a system of rewards with deep reinforcement learning (deep RL). Using end-to-end neural networks that translate raw pixels into actions, RL-trained agents are capable of exhibiting intuitive behaviors and performing complex tasks.

Ultimately, our aim will be to train reinforcement learning agents from virtual robotic simulation in 3D and transfer the agent to a real-world robot. Reinforcement learners choose the best action for the agent to perform based on environmental state (like camera inputs) and rewards that provide feedback to the agent about it's performance. Reinforcement learning can learn to behave optimally in it's environment given a policy, or task - like obtaining the reward.

In many scenarios, the state space is significantly complex and multi-dimensional to where neural networks are increasingly used to predict the best action, which is where deep reinforcement learning and GPU acceleration comes into play. With deep reinforcement learning, the agents are typically processing 2D imagery using convolutional neural networks (CNNs), processing inputs that are an order of magnitude more complex than low-dimensional RL, and have the ability to learn "from vision" with the end-to-end network (referred to as "pixels-to-actions").

This repository includes discrete Deep Q-Learning (DQN) and continuous A3G algorithms in PyTorch, examples and an interoperability library API in C++ for integrating with Linux applications in robotics, simulation, and deployment to the field.

Table of Contents

note: stream our webinar on the topic that follows this tutorial.

Building from Source

Run the following commands from terminal to build from source:

$ sudo apt-get install cmake
$ git clone http://github.com/dusty-nv/jetson-reinforcement
$ cd jetson-reinforcement
$ git submodule update --init
$ mkdir build
$ cd build
$ cmake ../
$ make

During the cmake step, PyTorch will be compiled and installed so it can take awhile (around ~30 minutes to an hour on the Jetson). The stable version of PyTorch we are currently using is 0.3.0. The build script will download pacekages and ask you for your sudo password during the install.

Verifying PyTorch

Before proceeding, to make sure that PyTorch installed correctly, and to get an introduction to PyTorch if you aren't already familiar, we have provided a Jupyter IPython notebook called intro-pytorch.ipynb that includes some simple PyTorch examples that verify the install and test the CUDA/cuDNN support in PyTorch.

To launch the notebook locally on your system, run the following commands:

$ cd jetson-reinforcement/build/aarch64/bin   # or cd x86_64/bin on PC
$ jupyter notebook 
# click on:  intro-pytorch.ipynb

Alternatively, if you wish to skip the notebook and run the PyTorch verification commands directly, you can do so by launching an interactive Python shell with the python command and running the following:

>>> import pytorch
>>> print(torch.__version__)
>>> print('CUDA available: ' + str(torch.cuda.is_available()))
>>> a = torch.cuda.FloatTensor(2).zero_()
>>> print('Tensor a = ' + str(a))
>>> b = torch.randn(2).cuda()
>>> print('Tensor b = ' + str(b))
>>> c = a + b
>>> print('Tensor c = ' + str(c))

If PyTorch is installed correctly on your system, the output should be as follows:

Python 2.7.12 (default, Nov 19 2016, 06:48:10) 
[GCC 5.4.0 20160609] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import pytorch
>>> print(torch.__version__)
0.3.0b0+af3964a
>>> print('CUDA available: ' + str(torch.cuda.is_available()))
CUDA available: True
>>> a = torch.cuda.FloatTensor(2).zero_()
>>> print('Tensor a = ' + str(a))
Tensor a = 
 0
 0
[torch.cuda.FloatTensor of size 2 (GPU 0)]

>>> b = torch.randn(2).cuda()
>>> print('Tensor b = ' + str(b))
Tensor b = 
 0.2190
-0.3212
[torch.cuda.FloatTensor of size 2 (GPU 0)]

>>> c = a + b
>>> print('Tensor c = ' + str(c))
Tensor c = 
 0.2190
-0.3212
[torch.cuda.FloatTensor of size 2 (GPU 0)]

Now we have verified that PyTorch is loading, able to detect GPU acceleration, is able to allocate tensors on the GPU, and is able to perform basic tensor operations using CUDA.

DQN + OpenAI Gym

In order to first test and verify that the deep reinforcement learning algorithms are indeed learning, we'll run them inside OpenAI Gym environments (in 2D). As an introduction to the DQN algorithm, a second CUDA-enabled IPython notebook is included in the repo, intro-DQN.ipynb. This notebook applies the DQN on video captured from the Gym's CartPole environment, so it's learning "from vision" on the GPU, as opposed to low-dimensional parameters from the game like traditional RL.

Although CartPole is a toy example, it's vital to start with a simple example to eliminate potential issues early on before graduating to more complex 3D scenarios that will become more difficult to debug, and since the DQN learns from a raw 2D pixel array it's still considered deep reinforcement learning. It's recommended to follow along with the notebook below to familiarize yourself with the DQN algorithm for when we transition to using it from C++ in more complex environments later in the repo.

Cartpole

To launch the notebook locally from your machine, run the following commands:

$ cd jetson-reinforcement/build/aarch64/bin   # or cd x86_64/bin on PC
$ jupyter notebook
# click on:  intro-DQN.ipynb

Inside of the notebook, the DQN is set to only run for 50 episodes. After you have witnessed the DQN start to converge and the CartPole begin to remain upright for longer periods of time, exit the notebook and run the standalone gym-DQN.py script from the terminal for improved performance:

$ python gym-DQN.py

(assuming the current directory of your terminal is still jetson-reinforcement/build/<arch>/bin from above)

Three windows should appear showing the cartpole game, a graph of peformance, and the DQN agent should begin learning. The longer the DQN agent is able to balance the pole on the moving cart, the more points it's rewarded. In Gym, a score of 200 indicates the scenario has been mastered. After a short while of training, the agent should achieve it and the program will quit.

Lunar Lander

Using a similar script, you can experiment in different Gym environments with the --env parameter:

$ python gym-RL.py --env=LunarLander-v2 --render

The LunarLander-v2 environment is fun to explore because it's a similar task to drone auto-landing, and hence relevant to robotics. At first, the lander will crash wildly, but starting around episode 50, you may notice it start to attempt to remain between the flags, and after a couple hundred episodes, it should start to land with a controlled descent. In the terminal, you should see the reward becoming positive and increasing over time towards 200:

Episode 010   Reward: -508.10   Last length: 079   Average length: 18.20
Episode 020   Reward: -301.04   Last length: 088   Average length: 25.02
Episode 030   Reward: -208.76   Last length: 102   Average length: 31.96
Episode 040   Reward:  -98.75   Last length: 071   Average length: 48.18
Episode 050   Reward: -155.66   Last length: 107   Average length: 53.96
Episode 060   Reward: -103.31   Last length: 091   Average length: 58.13
Episode 070   Reward:  -64.71   Last length: 095   Average length: 64.51
Episode 080   Reward:  -93.23   Last length: 147   Average length: 76.15
Episode 090   Reward: -150.40   Last length: 120   Average length: 86.76
Episode 100   Reward: -218.14   Last length: 100   Average length: 98.21
Episode 110   Reward:  -93.55   Last length: 101   Average length: 100.55
Episode 120   Reward:  -32.54   Last length: 120   Average length: 105.52
Episode 130   Reward: -112.93   Last length: 183   Average length: 120.30
Episode 140   Reward: -188.25   Last length: 110   Average length: 149.31
Episode 150   Reward:  -78.87   Last length: 176   Average length: 148.66
Episode 160   Reward:  +11.95   Last length: 174   Average length: 153.23
Episode 170   Reward: +131.50   Last length: 252   Average length: 155.50
Episode 180   Reward: +110.42   Last length: 128   Average length: 154.47
Episode 190   Reward:  +86.32   Last length: 161   Average length: 156.21
Episode 200   Reward: +111.07   Last length: 505   Average length: 162.06

Next, we'll look at integrating these standalone Python examples into robotics code via our C++ wrapper library.

Digging into the C++ API

To take these deep reinforcement learners from monolithic Python examples into libray form that can be integrated with robots and simulators, we provide a C++ wrapper library and API to the Python code. Underneath, the library uses Python's low-level C FFI to pass the tensor memory between the application and PyTorch without extra copies (ZeroCopy).

The library is architected to be modular and extended to support new types of learning algorithms. Below is pseudocode illustrating the signature of the rlAgent interface which the RL implementations inherit from:

/**
 * Base class for deep reinforcement learning agent
 */
class rlAgent
{
public:
	/**
	 * Create a new instance of a module for training an agent.
	 */
     static rlAgent* Create( uint32_t width, uint32_t height, 
                             uint32_t channels, uint32_t numActions );

	/**
	 * Destructor
	 */
	virtual ~rlAgent();

	/**
	 * From the input state, predict the next action
	 */
	virtual bool NextAction( Tensor* state, int* action );

	/**
	 * Issue the next reward and training iteration
	 */
	virtual bool NextReward( float reward, bool end_episode );
};

Included in the repo are different implementations of the agent, including dqnAgent which we will use in the simulation scenarios to follow. The user provides their sensor data, or environmental state, to the NextAction() function, which calls the Python script and returns the predicted action, which the user then applies to their robot or simulation.

Next the reward is issued in the NextReward() function, which provides feedback to the learner from the environment and kicks off the next training iteration that makes the agent learn over time.

Testing the C++ API

To make sure that the reinforcement learners are still functioning properly from C++, some simple examples of using the API called catch and fruit are provided. Similar in concept to pong, in catch a ball drops from the top of the environment which the agent must catch before the ball reaches the bottom of the screen, by moving it's paddle left or right.

Catch

Unlike the previous examples which were monolithic Python scripts, the catch sample is a simple C/C++ program which links to the reinforcement learning library outlined above. To test the textual catch sample, run the following executable from the terminal. After around 100 episodes or so, the agent should start winning the episodes nearly 100% of the time:

$ ./catch 
[deepRL]  input_width:    64
[deepRL]  input_height:   64
[deepRL]  input_channels: 1
[deepRL]  num_actions:    3
[deepRL]  optimizer:      RMSprop
[deepRL]  learning rate:  0.01
[deepRL]  replay_memory:  10000
[deepRL]  batch_size:     32
[deepRL]  gamma:          0.9
[deepRL]  epsilon_start:  0.9
[deepRL]  epsilon_end:    0.05
[deepRL]  epsilon_decay:  200.0
[deepRL]  allow_random:   1
[deepRL]  debug_mode:     0
[deepRL]  creating DQN model instance
[deepRL]  DQN model instance created
[deepRL]  DQN script done init
[cuda]  cudaAllocMapped 16384 bytes, CPU 0x1020a800000 GPU 0x1020a800000
[deepRL]  pyTorch THCState  0x0318D490
[deepRL]  nn.Conv2d() output size = 800
WON! episode 1
001 for 001  (1.0000)  
WON! episode 5
004 for 005  (0.8000)  
WON! episode 10
007 for 010  (0.7000)  
WON! episode 15
010 for 015  (0.6667)  
WON! episode 20
013 for 020  (0.6500)  13 of last 20  (0.65)  (max=0.65)
WON! episode 25
015 for 025  (0.6000)  11 of last 20  (0.55)  (max=0.65)
LOST episode 30
018 for 030  (0.6000)  11 of last 20  (0.55)  (max=0.65)
LOST episode 35
019 for 035  (0.5429)  09 of last 20  (0.45)  (max=0.65)
WON! episode 40
022 for 040  (0.5500)  09 of last 20  (0.45)  (max=0.65)
LOST episode 45
024 for 045  (0.5333)  09 of last 20  (0.45)  (max=0.65)
WON! episode 50
027 for 050  (0.5400)  09 of last 20  (0.45)  (max=0.65)
WON! episode 55
031 for 055  (0.5636)  12 of last 20  (0.60)  (max=0.65)
LOST episode 60
034 for 060  (0.5667)  12 of last 20  (0.60)  (max=0.65)
WON! episode 65
038 for 065  (0.5846)  14 of last 20  (0.70)  (max=0.70)
WON! episode 70
042 for 070  (0.6000)  15 of last 20  (0.75)  (max=0.75)
LOST episode 75
045 for 075  (0.6000)  14 of last 20  (0.70)  (max=0.75)
WON! episode 80
050 for 080  (0.6250)  16 of last 20  (0.80)  (max=0.80)
WON! episode 85
055 for 085  (0.6471)  17 of last 20  (0.85)  (max=0.85)
WON! episode 90
059 for 090  (0.6556)  17 of last 20  (0.85)  (max=0.85)
WON! episode 95
063 for 095  (0.6632)  18 of last 20  (0.90)  (max=0.90)
WON! episode 100
068 for 100  (0.6800)  18 of last 20  (0.90)  (max=0.90)
WON! episode 105
073 for 105  (0.6952)  18 of last 20  (0.90)  (max=0.90)
WON! episode 110
078 for 110  (0.7091)  19 of last 20  (0.95)  (max=0.95)
WON! episode 111
079 for 111  (0.7117)  19 of last 20  (0.95)  (max=0.95)
WON! episode 112
080 for 112  (0.7143)  20 of last 20  (1.00)  (max=1.00)

Internally, catch is using the dqnAgent API from our C++ library to implement the learning.

Alternate Arguments

There are some optional command line parameters to catch that you can play around with, to change the dimensions of the environment and pixel array input size, increasing the complexity to see how it impacts convergence and training times:

$ ./catch --width=96 --height=96
$ ./catch --render  # enable text output of the environment

With 96x96 environment size, the catch agent achieves >75% accuracy after around 150-200 episodes.
With 128x128 environment size, the catch agent achieves >75% accuracy after around 325 episodes.

Fruit

Next, we provide a 2D graphical sample in C++ called fruit, where the agent appears at random locations and must find the "fruit" object to gain the reward and win episodes before running out of bounds or the timeout period expires. The fruit agent has 4 possible actions to choose from: moving up, down, left, and right on the screen in order to navigate to the object.

Note this C++ example is running mostly on the GPU, with the rudimentary 2D rasterization of the environment in CUDA along with the DQN, and the display visualization in OpenGL. Like before, it is learning "from vision" using to translate the raw pixel array into actions using deep reinforcement learning.

An analog to more complex navigation and motion planning tasks, the simple fruit example intended to prove that the dqnAgent is able of visually identifying and navigating to objects of interest from any starting location. Later on in the repo, we will build on that path-planning capability in the 3D robotic simulations.

Running the Sample

To start fruit, launch the following executable from the terminal:

$ ./fruit

It should achieve around 95% accuracy after around ~100 episodes within the default 48x48 environment:

action = DOWN   reward = +0.0628     wins = 052 of 094 (0.55)   16 of last 20  (0.80)  (max=0.80)
action = LEFT   reward = +0.0453     wins = 052 of 094 (0.55)   16 of last 20  (0.80)  (max=0.80)
action = LEFT   reward = +0.0271     wins = 052 of 094 (0.55)   17 of last 20  (0.85)  (max=0.85)
action = LEFT   reward = +0.0084     wins = 052 of 094 (0.55)   17 of last 20  (0.85)  (max=0.85)
action = UP     reward = +0.1208     wins = 052 of 094 (0.55)   17 of last 20  (0.85)  (max=0.85)
action = LEFT   reward = +0.1154     wins = 052 of 094 (0.55)   17 of last 20  (0.85)  (max=0.85)
action = UP     reward = +1.0000 EOE wins = 053 of 095 (0.56)   17 of last 20  (0.85)  (max=0.85)
action = DOWN   reward = +0.1441     wins = 053 of 095 (0.56)   18 of last 20  (0.90)  (max=0.90)
action = DOWN   reward = +0.1424     wins = 053 of 095 (0.56)   18 of last 20  (0.90)  (max=0.90)
action = DOWN   reward = +0.1406     wins = 053 of 095 (0.56)   18 of last 20  (0.90)  (max=0.90)
action = DOWN   reward = +0.1386     wins = 053 of 095 (0.56)   18 of last 20  (0.90)  (max=0.90)
action = DOWN   reward = +0.1365     wins = 054 of 096 (0.57)   19 of last 20  (0.95)  (max=0.95)
action = DOWN   reward = +0.1342     wins = 054 of 096 (0.57)   19 of last 20  (0.95)  (max=0.95)
action = RIGHT  reward = +0.0134     wins = 054 of 096 (0.57)   19 of last 20  (0.95)  (max=0.95)

Alternate Arguments

In a similar vein to the catch sample, there are some optional command line parameters to fruit that you can exercise:

$ ./fruit --width=64 --height=64 --episode_max_frames=100

When increasing the dimensions of the environment and pixel array input, the episode_max_frames should be increased accordingly, as the agent will require more time to get across the screen in a larger environment before the episode time-out.

3D Simulation

Up until this point in the repo, the environments have been 2D, namely to confirm that the deep RL algorithms are learning as intended. To migrate the agent to operating in 3D worlds, we're going to use the Gazebo robotic simulator to simulate different autonomous machines including a robotic arm and rover, which can then be transfered to the real-world robots.

Robotic Arm

Our first Gazebo environment trains a robotic arm to touch objects without needing explicit IK (Inverse Kinematics).
The arm's motion planning is learned internally by the network. To get started, run the following script from the terminal:

$ ./gazebo-arm.sh

The plugins which hook the learning into the simulation are located in the gazebo/ directory of the repo.
See ArmPlugin.cpp for the code that links Gazebo with the dqnAgent and controls the arm joints.

Once you notice the arm agent converging on the object, you can begin to move the object around the scene by pressing T on the keyboard to enable Translation mode in Gazebo, and then by clicking and dragging the object around the viewport.

Note that you will want to move the object so that the arm can still reach it, as the arm's rotational base is initially limited to around 45 degrees of travel in either direction.

Rover Navigation

We also have a skid-steer rover in Gazebo that learns to follow objects while avoiding the walls of it's environment, similar to the fruit scenario. To launch the rover simulation, run this script:

$ ./gazebo-rover.sh

Press Ctrl+T and subscribe to the ~/camera/link/camera/image topic to visualize the scene from the camera.

Similar to the arm, once you notice the rover consistently finding the object (in this case the green box), you can move the object around the scene by pressing T first. Note that there's an episode timeout similar to fruit, so you won't want to move the object too far away without first increasing the rover's maxEpisodeLength in the code and re-compiling.

Continuous Control

The DQN agent that we've been using is discrete, meaning that the network selects one output neuron per timestep, that the user then explicitly maps or defines to correspond to an action (typically increasing/decreasing a position or velocity by a delta amount). This means that for each degree of freedom in the robot, 2 outputs are required - one to increase the variable by the delta and another to decrease it.

In more complex real-world scenarious it's often advantageous to control all degrees of freedom simultaneously and to have the network output the precise value of these variables. For example, if you wanted to teach a humanoid to walk (which can have 20-40 or more degrees of freedom), controlling all the joints simultaneously would be important to it's stability.

For continuous control, there exists a class of more advanced deep reinforcement learners called Actor/Critic — an active area of research that's recently yielded the latest state-of-the-art solutions like DDPG, ACKTR, and A3C/A3G.

Bipedal Walker

To demonstrate a continuous learner on one of the most challenging and difficult OpenAI Gym environments, BipedalWalkerHardcore-v2, included in the repo is a demo of A3G, which launches many Gym instances to learn more quickly in parallel using the GPU. To launch the A3G solver, run the following commands from terminal:

$ cd jetson-reinforcement/python/A3G
$ python main.py --env BipedalWalkerHardcore-v2 --workers 8 --gpu-ids 0 --amsgrad True --model CONV --stack-frames 4

Depending on settings and system resources, it typically takes A3G between 90-120 minutes to master the environment by clearing the hurdles and pitfalls. If you have multiple GPUs in a PC or server, you can disable rendering and increase the number of worker threads and specify additional gpu-ids to speed up training.

Appendix: Using LUA

By default, the repo builds with PyTorch and Python. However, there's also support included for Torch7 and LUA script with a compile flag. The process is scripted to automatically install dependencies like Torch7 and build the project from source.
You may be required to enter the sudo password at some point.

1. Cloning GitHub repo

First, make sure build tools

$ sudo apt-get install git cmake
$ git clone http://github.com/dusty-nv/jetson-reinforcement

2. Configuring build

$ cd jetson-reinforcement
$ mkdir build
$ cd build
$ cmake ../ -DUSE_LUA=yes -DUSE_PYTHON=no

This will initiate the building of dependencies like Torch and it's bindings for CUDA/cuDNN, which can take some time.

3. Compiling

$ cd jetson-inference/build     # omit if pwd is already this directory from step #2
$ make

Depending on architecture, the package will be built to either armhf or aarch64, with the following directory structure:

|-build
   \aarch64		    (64-bit)
      \bin			where the application binaries are built to
      \include		where the headers reside
      \lib			where the libraries are build to
   \armhf           (32-bit)
      \bin			where the application binaries are built to
      \include		where the headers reside
      \lib			where the libraries are build to

Verifying Lua + Torch Install

After either Building from Source or [Downloading the Package](#downloading-the-package], verify the LuaJIT-5.1 / Torch7 scripting environment with these commands:

$ cd aarch64/bin

$ ./deepRL-console hello.lua			# verify Lua interpreter (consult if unfamiliar with Lua)

[deepRL]  created new lua_State
[deepRL]  opened LUA libraries
[deepRL]  loading 'hello.lua'

HELLO from LUA!
my variable equals 16
list  1
map.x 10
one
two
3
4
5
6
7
8
9
10
multiply = 200
goodbye!

[deepRL]  closing lua_State

This command will test loading Torch7 packages and bindings for CUDA/cuDNN:

$ ./deepRL-console test-packages.lua    # load Torch packages and bindings

[deepRL]  created new lua_State
[deepRL]  opened LUA libraries
[deepRL]  loading 'test-packages.lua'

[deepRL]  hello from within Torch/Lua environment (time=0.032163)
[deepRL]  loading Lua packages...
[deepRL]  loading torch...
[deepRL]  loading cutorch...
cutorch.hasHalf == false
[deepRL]  loading nn...
[deepRL]  loading cudnn...
[deepRL]  loading math...
[deepRL]  loading nnx...
[deepRL]  loading optim...
[deepRL]  done loading packages. (time=5.234669)

[deepRL]  closing lua_State

These scripts should run normally and verify the Lua / Torch environment is sane.

the deepRL-console program can launch a user's script from the command line (CLI).

Playing Catch with the LUA Q-Learner

Next, to verify that the reinforcement Q-learner learns like it's supposed to, let's play a simple game: half-pong, or catch.

$ ./deepRL-console catchDQN.lua

Launching the script above should begin your Jetson playing games of catch and plotting the learning process in realtime:

Each epoch is one game of play, where the ball drops from the top of the screen to the bottom. After a few hundred epochs, the Q-learner should be starting to catch the ball the majority of the time.

jetson-reinforcement's People

Contributors

andersy005 avatar dusty-nv avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

jetson-reinforcement's Issues

Makefile:83: recipe for target 'all' failed

[ 67%] Building CXX object samples/catch/CMakeFiles/catch.dir/catch.cpp.o
[ 69%] Linking CXX executable ../../x86_64/bin/catch
/usr/bin/ld: warning: libmkl_gf_lp64.so, needed by /home/dhruv/jetson-reinforcement/build/pytorch/torch/lib/libTH.so.1, not found (try using -rpath or -rpath-link)
/usr/bin/ld: warning: libmkl_gnu_thread.so, needed by /home/dhruv/jetson-reinforcement/build/pytorch/torch/lib/libTH.so.1, not found (try using -rpath or -rpath-link)
/usr/bin/ld: warning: libmkl_core.so, needed by /home/dhruv/jetson-reinforcement/build/pytorch/torch/lib/libTH.so.1, not found (try using -rpath or -rpath-link)
/home/dhruv/jetson-reinforcement/build/pytorch/torch/lib/libTH.so.1: undefined reference to dger_' /home/dhruv/jetson-reinforcement/build/pytorch/torch/lib/libTH.so.1: undefined reference to sgeqrf_'
/home/dhruv/jetson-reinforcement/build/pytorch/torch/lib/libTH.so.1: undefined reference to ssyev_' /home/dhruv/jetson-reinforcement/build/pytorch/torch/lib/libTH.so.1: undefined reference to sgesvd_'
/home/dhruv/jetson-reinforcement/build/pytorch/torch/lib/libTH.so.1: undefined reference to dsyev_' /home/dhruv/jetson-reinforcement/build/pytorch/torch/lib/libTH.so.1: undefined reference to dorgqr_'
/home/dhruv/jetson-reinforcement/build/pytorch/torch/lib/libTH.so.1: undefined reference to dpotri_' /home/dhruv/jetson-reinforcement/build/pytorch/torch/lib/libTH.so.1: undefined reference to scopy_'
/home/dhruv/jetson-reinforcement/build/pytorch/torch/lib/libTH.so.1: undefined reference to sger_' /home/dhruv/jetson-reinforcement/build/pytorch/torch/lib/libTH.so.1: undefined reference to dgesv_'
/home/dhruv/jetson-reinforcement/build/pytorch/torch/lib/libTH.so.1: undefined reference to sgels_' /home/dhruv/jetson-reinforcement/build/pytorch/torch/lib/libTH.so.1: undefined reference to dcopy_'
/home/dhruv/jetson-reinforcement/build/pytorch/torch/lib/libTH.so.1: undefined reference to dgels_' /home/dhruv/jetson-reinforcement/build/pytorch/torch/lib/libTH.so.1: undefined reference to sgemm_'
/home/dhruv/jetson-reinforcement/build/pytorch/torch/lib/libTH.so.1: undefined reference to dtrtrs_' /home/dhruv/jetson-reinforcement/build/pytorch/torch/lib/libTH.so.1: undefined reference to sorgqr_'
/home/dhruv/jetson-reinforcement/build/pytorch/torch/lib/libTH.so.1: undefined reference to spotrs_' /home/dhruv/jetson-reinforcement/build/pytorch/torch/lib/libTH.so.1: undefined reference to dpstrf_'
/home/dhruv/jetson-reinforcement/build/pytorch/torch/lib/libTH.so.1: undefined reference to sgetri_' /home/dhruv/jetson-reinforcement/build/pytorch/torch/lib/libTH.so.1: undefined reference to sgetrs_'
/home/dhruv/jetson-reinforcement/build/pytorch/torch/lib/libTH.so.1: undefined reference to dpotrf_' /home/dhruv/jetson-reinforcement/build/pytorch/torch/lib/libTH.so.1: undefined reference to dgetri_'
/home/dhruv/jetson-reinforcement/build/pytorch/torch/lib/libTH.so.1: undefined reference to dswap_' /home/dhruv/jetson-reinforcement/build/pytorch/torch/lib/libTH.so.1: undefined reference to sormqr_'
/home/dhruv/jetson-reinforcement/build/pytorch/torch/lib/libTH.so.1: undefined reference to daxpy_' /home/dhruv/jetson-reinforcement/build/pytorch/torch/lib/libTH.so.1: undefined reference to dgeqrf_'
/home/dhruv/jetson-reinforcement/build/pytorch/torch/lib/libTH.so.1: undefined reference to strtrs_' /home/dhruv/jetson-reinforcement/build/pytorch/torch/lib/libTH.so.1: undefined reference to dormqr_'
/home/dhruv/jetson-reinforcement/build/pytorch/torch/lib/libTH.so.1: undefined reference to dgemv_' /home/dhruv/jetson-reinforcement/build/pytorch/torch/lib/libTH.so.1: undefined reference to dpotrs_'
/home/dhruv/jetson-reinforcement/build/pytorch/torch/lib/libTH.so.1: undefined reference to dscal_' /home/dhruv/jetson-reinforcement/build/pytorch/torch/lib/libTH.so.1: undefined reference to dgemm_'
/home/dhruv/jetson-reinforcement/build/pytorch/torch/lib/libTH.so.1: undefined reference to sgesv_' /home/dhruv/jetson-reinforcement/build/pytorch/torch/lib/libTH.so.1: undefined reference to dgetrf_'
/home/dhruv/jetson-reinforcement/build/pytorch/torch/lib/libTH.so.1: undefined reference to mkl_get_max_threads' /home/dhruv/jetson-reinforcement/build/pytorch/torch/lib/libTH.so.1: undefined reference to dgeev_'
/home/dhruv/jetson-reinforcement/build/pytorch/torch/lib/libTH.so.1: undefined reference to sgetrf_' /home/dhruv/jetson-reinforcement/build/pytorch/torch/lib/libTH.so.1: undefined reference to dgesvd_'
/home/dhruv/jetson-reinforcement/build/pytorch/torch/lib/libTH.so.1: undefined reference to spotrf_' /home/dhruv/jetson-reinforcement/build/pytorch/torch/lib/libTH.so.1: undefined reference to dgetrs_'
/home/dhruv/jetson-reinforcement/build/pytorch/torch/lib/libTH.so.1: undefined reference to spstrf_' /home/dhruv/jetson-reinforcement/build/pytorch/torch/lib/libTH.so.1: undefined reference to saxpy_'
/home/dhruv/jetson-reinforcement/build/pytorch/torch/lib/libTH.so.1: undefined reference to sgeev_' /home/dhruv/jetson-reinforcement/build/pytorch/torch/lib/libTH.so.1: undefined reference to spotri_'
/home/dhruv/jetson-reinforcement/build/pytorch/torch/lib/libTH.so.1: undefined reference to sgemv_' /home/dhruv/jetson-reinforcement/build/pytorch/torch/lib/libTH.so.1: undefined reference to ddot_'
/home/dhruv/jetson-reinforcement/build/pytorch/torch/lib/libTH.so.1: undefined reference to sscal_' /home/dhruv/jetson-reinforcement/build/pytorch/torch/lib/libTH.so.1: undefined reference to sswap_'
/home/dhruv/jetson-reinforcement/build/pytorch/torch/lib/libTH.so.1: undefined reference to `cblas_sdot'
collect2: error: ld returned 1 exit status
samples/catch/CMakeFiles/catch.dir/build.make:100: recipe for target 'x86_64/bin/catch' failed
make[2]: *** [x86_64/bin/catch] Error 1
CMakeFiles/Makefile2:320: recipe for target 'samples/catch/CMakeFiles/catch.dir/all' failed
make[1]: *** [samples/catch/CMakeFiles/catch.dir/all] Error 2
Makefile:83: recipe for target 'all' failed
make: *** [all] Error 2

Patches needed to make this work on L4T 4.4.38-tegra

The installation instructions do not hold for current out of the box Jetson TX2, which at this time is 4.4.38-tegra. There are some slight changes that need to be made. The first is enabling the universe repositories in /etc/apt/sources.list so the pre-build script can, at the least, successfully sudo apt-get install python-pip:

https://gist.github.com/chrislgarry/40e9cd3687eb3803e190ce3aeea05edb

The second is to pass the pyzmq version that works nicely with jupyter notebooks to pip:

https://gist.github.com/chrislgarry/af7be9ec17fbf0cd8f6883873f4bdbeb

I believe there is a PR for the latter fix. Running pip install --upgrade may work as well instead of that patch. See jupyter/notebook#3579

xavier support?

this whole setup doesn't work on Xavier. it generates random errors. I was able to make and run all the examples on Jetson TX2. What is the recommended setup procedure on xavier?

CMakePreBuild.sh

does it work with the most recent Jetpack for TX2? I am getting errors:
Pre-build] Do you wish to install Gazebo robotics simulator (y/N)? n
[Pre-build] skipping Gazebo installation
./CMakePreBuild.sh: line 45: [: =: unary operator expected
./CMakePreBuild.sh: line 45: [: =: unary operator expected
./CMakePreBuild.sh: line 45: [: =: unary operator expected
./CMakePreBuild.sh: line 131: [: =: unary operator expected
./CMakePreBuild.sh: line 131: [: =: unary operator expected
./CMakePreBuild.sh: line 131: [: =: unary operator expected

c++ wrapper pyimport

Hi Dustin, thanks for this repo.
I am stuck at c++ wrapper especially this line results in segmentation fault (core dumped):
pyModule = PyImport_Import(pyModuleName);

Thanks

Issue with building pytorch for jetson tx1

Experienced this issue with make

In file included from /home/ubuntu/Desktop/jetson-reinforcement/c/pyTensor.cpp:6:0:
/home/ubuntu/Desktop/jetson-reinforcement/c/pyTorch.h:14:19: fatal error: TH/TH.h: No such file or directory
compilation terminated.
CMakeFiles/jetson-reinforcement.dir/build.make:95: recipe for target 'CMakeFiles/jetson-reinforcement.dir/c/pyTensor.cpp.o' failed
make[2]: *** [CMakeFiles/jetson-reinforcement.dir/c/pyTensor.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

how to install jupyter notebook in jetson TX2?

Hi dusty, my name is ji-hoon Beak from korea.

I have seeing jetson-reinforcement in your git and try install.

I could do step1( : "Building from Source"). however I could not do step2(: "Verifying PyTorch")..
When I type "jupyter notebook intro-pytorch.ipynb" into the terminal, the following error message is displayed.

Error executing Jupiter command 'notebook': [Errno 2] No such file or directory

So I tried to install notebook using anaconda3 but failed because anaconda3 does not support the architecture of jetsonTX2.
Also, I try installed notebook using pip, but it was printed as below.

$ pip install jupyter

Collecting jupyter
Using cached https://files.pythonhosted.org/packages/83/df/0f5dd132200728a86190397e1ea87cd76244e42d39ec5e88efd25b2abd7e/jupyter-1.0.0-py2.py3-none-any.whl
Requirement already satisfied: nbconvert in /usr/local/lib/python2.7/dist-packages (from jupyter) (5.3.1)
Collecting ipywidgets (from jupyter)
Downloading https://files.pythonhosted.org/packages/f0/5d/868df21e3b004a5a61294cab70e1f6f44986933eb3aa9c396dfd5112acb2/ipywidgets-7.3.0-py2.py3-none-any.whl (109kB)
100% |████████████████████████████████| 112kB 1.0MB/s
Collecting notebook (from jupyter)
Using cached https://files.pythonhosted.org/packages/5e/7c/7fd8e9584779d65dfcad9fa2e09c76131a41f999f853a9c7026ed8585586/notebook-5.6.0-py2.py3-none-any.whl
Collecting ipykernel (from jupyter)
Using cached https://files.pythonhosted.org/packages/8e/65/c7ca3e3d05f9bd51b3010076b84f4e7304b12d0abf62a48f6cec2c90c019/ipykernel-4.8.2-py2-none-any.whl
Collecting qtconsole (from jupyter)
Using cached https://files.pythonhosted.org/packages/90/ff/047e0dca2627b162866920e7aa93f04523c0ae81e5c67060eec85701992d/qtconsole-4.3.1-py2.py3-none-any.whl
Collecting jupyter-console (from jupyter)
Using cached https://files.pythonhosted.org/packages/77/82/6469cd7fccf7958cbe5dce2e623f1e3c5e27f1bb1ad36d90519bc2d5d370/jupyter_console-5.2.0-py2.py3-none-any.whl
Requirement already satisfied: pandocfilters>=1.4.1 in /usr/local/lib/python2.7/dist-packages (from nbconvert->jupyter) (1.4.2)
Requirement already satisfied: entrypoints>=0.2.2 in /usr/local/lib/python2.7/dist-packages (from nbconvert->jupyter) (0.2.3)
Requirement already satisfied: jinja2 in /usr/lib/python2.7/dist-packages (from nbconvert->jupyter) (2.8)
Requirement already satisfied: testpath in /usr/local/lib/python2.7/dist-packages (from nbconvert->jupyter) (0.3.1)
Requirement already satisfied: mistune>=0.7.4 in /usr/local/lib/python2.7/dist-packages (from nbconvert->jupyter) (0.8.3)
Requirement already satisfied: nbformat>=4.4 in /usr/local/lib/python2.7/dist-packages (from nbconvert->jupyter) (4.4.0)
Requirement already satisfied: pygments in /usr/lib/python2.7/dist-packages (from nbconvert->jupyter) (2.1)
Requirement already satisfied: jupyter-core in /usr/local/lib/python2.7/dist-packages (from nbconvert->jupyter) (4.4.0)
Requirement already satisfied: bleach in /usr/local/lib/python2.7/dist-packages (from nbconvert->jupyter) (2.1.3)
Requirement already satisfied: traitlets>=4.2 in /usr/local/lib/python2.7/dist-packages (from nbconvert->jupyter) (4.3.2)
Requirement already satisfied: ipython<6.0.0,>=4.0.0; python_version < "3.3" in /usr/local/lib/python2.7/dist-packages (from ipywidgets->jupyter) (5.7.0)
Collecting widgetsnbextension~=3.3.0 (from ipywidgets->jupyter)
Downloading https://files.pythonhosted.org/packages/b9/43/f6ff09448f7b961e102fd75b7e46a5d44b68b9746bb1ab5c4be64c3e236d/widgetsnbextension-3.3.0-py2.py3-none-any.whl (2.2MB)
100% |████████████████████████████████| 2.2MB 1.9MB/s
Requirement already satisfied: ipython-genutils in /usr/local/lib/python2.7/dist-packages (from notebook->jupyter) (0.2.0)
Requirement already satisfied: prometheus-client in /usr/local/lib/python2.7/dist-packages (from notebook->jupyter) (0.3.0)
Requirement already satisfied: Send2Trash in /usr/local/lib/python2.7/dist-packages (from notebook->jupyter) (1.5.0)
Collecting jupyter-client>=5.2.0 (from notebook->jupyter)
Using cached https://files.pythonhosted.org/packages/94/dd/fe6c4d683b09eb05342bd2816b7779663f71762b4fa9c2d5203d35d17354/jupyter_client-5.2.3-py2.py3-none-any.whl
Requirement already satisfied: tornado>=4 in /usr/lib/python2.7/dist-packages (from notebook->jupyter) (4.2.1)
Collecting terminado>=0.8.1 (from notebook->jupyter)
Using cached https://files.pythonhosted.org/packages/2e/20/a26211a24425923d46e1213b376a6ee60dc30bcdf1b0c345e2c3769deb1c/terminado-0.8.1-py2.py3-none-any.whl
Collecting pyzmq>=17 (from notebook->jupyter)
Using cached https://files.pythonhosted.org/packages/aa/fd/f2e65a05558ff8b58b71404efc79c2b03cef922667260e1d703896597b93/pyzmq-17.1.0.tar.gz
Requirement already satisfied: ipaddress; python_version == "2.7" in /usr/lib/python2.7/dist-packages (from notebook->jupyter) (1.0.16)
Requirement already satisfied: prompt-toolkit<2.0.0,>=1.0.0 in /usr/local/lib/python2.7/dist-packages (from jupyter-console->jupyter) (1.0.15)
Requirement already satisfied: configparser>=3.5; python_version == "2.7" in /usr/local/lib/python2.7/dist-packages (from entrypoints>=0.2.2->nbconvert->jupyter) (3.5.0)
Requirement already satisfied: MarkupSafe in /usr/lib/python2.7/dist-packages (from jinja2->nbconvert->jupyter) (0.23)
Requirement already satisfied: jsonschema!=2.5.0,>=2.4 in /usr/local/lib/python2.7/dist-packages (from nbformat>=4.4->nbconvert->jupyter) (2.6.0)
Collecting html5lib!=1.0b1,!=1.0b2,!=1.0b3,!=1.0b4,!=1.0b5,!=1.0b6,!=1.0b7,!=1.0b8,>=0.99999999pre (from bleach->nbconvert->jupyter)
Using cached https://files.pythonhosted.org/packages/a5/62/bbd2be0e7943ec8504b517e62bab011b4946e1258842bc159e5dfde15b96/html5lib-1.0.1-py2.py3-none-any.whl
Requirement already satisfied: six in /usr/lib/python2.7/dist-packages (from bleach->nbconvert->jupyter) (1.10.0)
Requirement already satisfied: decorator in /usr/lib/python2.7/dist-packages (from traitlets>=4.2->nbconvert->jupyter) (4.0.6)
Requirement already satisfied: enum34; python_version == "2.7" in /usr/lib/python2.7/dist-packages (from traitlets>=4.2->nbconvert->jupyter) (1.1.2)
Requirement already satisfied: setuptools>=18.5 in /usr/lib/python2.7/dist-packages (from ipython<6.0.0,>=4.0.0; python_version < "3.3"->ipywidgets->jupyter) (20.7.0)
Requirement already satisfied: backports.shutil-get-terminal-size; python_version == "2.7" in /usr/local/lib/python2.7/dist-packages (from ipython<6.0.0,>=4.0.0; python_version < "3.3"->ipywidgets->jupyter) (1.0.0)
Collecting pexpect; sys_platform != "win32" (from ipython<6.0.0,>=4.0.0; python_version < "3.3"->ipywidgets->jupyter)
Using cached https://files.pythonhosted.org/packages/89/e6/b5a1de8b0cc4e07ca1b305a4fcc3f9806025c1b651ea302646341222f88b/pexpect-4.6.0-py2.py3-none-any.whl
Requirement already satisfied: pathlib2; python_version == "2.7" or python_version == "3.3" in /usr/local/lib/python2.7/dist-packages (from ipython<6.0.0,>=4.0.0; python_version < "3.3"->ipywidgets->jupyter) (2.3.2)
Collecting simplegeneric>0.8 (from ipython<6.0.0,>=4.0.0; python_version < "3.3"->ipywidgets->jupyter)
Using cached https://files.pythonhosted.org/packages/3d/57/4d9c9e3ae9a255cd4e1106bb57e24056d3d0709fc01b2e3e345898e49d5b/simplegeneric-0.8.1.zip
Requirement already satisfied: pickleshare in /usr/local/lib/python2.7/dist-packages (from ipython<6.0.0,>=4.0.0; python_version < "3.3"->ipywidgets->jupyter) (0.7.4)
Requirement already satisfied: python-dateutil>=2.1 in /usr/lib/python2.7/dist-packages (from jupyter-client>=5.2.0->notebook->jupyter) (2.4.2)
Collecting ptyprocess; os_name != "nt" (from terminado>=0.8.1->notebook->jupyter)
Using cached https://files.pythonhosted.org/packages/d1/29/605c2cc68a9992d18dada28206eeada56ea4bd07a239669da41674648b6f/ptyprocess-0.6.0-py2.py3-none-any.whl
Requirement already satisfied: wcwidth in /usr/local/lib/python2.7/dist-packages (from prompt-toolkit<2.0.0,>=1.0.0->jupyter-console->jupyter) (0.1.7)
Requirement already satisfied: functools32; python_version == "2.7" in /usr/local/lib/python2.7/dist-packages (from jsonschema!=2.5.0,>=2.4->nbformat>=4.4->nbconvert->jupyter) (3.2.3.post2)
Requirement already satisfied: webencodings in /usr/local/lib/python2.7/dist-packages (from html5lib!=1.0b1,!=1.0b2,!=1.0b3,!=1.0b4,!=1.0b5,!=1.0b6,!=1.0b7,!=1.0b8,>=0.99999999pre->bleach->nbconvert->jupyter) (0.5.1)
Requirement already satisfied: scandir; python_version < "3.5" in /usr/local/lib/python2.7/dist-packages (from pathlib2; python_version == "2.7" or python_version == "3.3"->ipython<6.0.0,>=4.0.0; python_version < "3.3"->ipywidgets->jupyter) (1.7)
launchpadlib 1.10.3 requires testresources, which is not installed.
Installing collected packages: pyzmq, jupyter-client, ptyprocess, terminado, ipykernel, notebook, widgetsnbextension, ipywidgets, qtconsole, jupyter-console, jupyter, html5lib, pexpect, simplegeneric
Running setup.py install for pyzmq ... error
Complete output from command /usr/bin/python -u -c "import setuptools, tokenize;file='/tmp/pip-install-F64xGG/pyzmq/setup.py';f=getattr(tokenize, 'open', open)(file);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, file, 'exec'))" install --record /tmp/pip-record-1UyN3n/install-record.txt --single-version-externally-managed --compile:
/usr/lib/python2.7/distutils/dist.py:267: UserWarning: Unknown distribution option: 'python_requires'
warnings.warn(msg)
running install
running build
running build_py
creating build
creating build/lib.linux-aarch64-2.7
creating build/lib.linux-aarch64-2.7/zmq
copying zmq/_future.py -> build/lib.linux-aarch64-2.7/zmq
copying zmq/error.py -> build/lib.linux-aarch64-2.7/zmq
copying zmq/decorators.py -> build/lib.linux-aarch64-2.7/zmq
copying zmq/init.py -> build/lib.linux-aarch64-2.7/zmq
creating build/lib.linux-aarch64-2.7/zmq/green
copying zmq/green/device.py -> build/lib.linux-aarch64-2.7/zmq/green
copying zmq/green/poll.py -> build/lib.linux-aarch64-2.7/zmq/green
copying zmq/green/core.py -> build/lib.linux-aarch64-2.7/zmq/green
copying zmq/green/init.py -> build/lib.linux-aarch64-2.7/zmq/green
creating build/lib.linux-aarch64-2.7/zmq/green/eventloop
copying zmq/green/eventloop/zmqstream.py -> build/lib.linux-aarch64-2.7/zmq/green/eventloop
copying zmq/green/eventloop/ioloop.py -> build/lib.linux-aarch64-2.7/zmq/green/eventloop
copying zmq/green/eventloop/init.py -> build/lib.linux-aarch64-2.7/zmq/green/eventloop
creating build/lib.linux-aarch64-2.7/zmq/devices
copying zmq/devices/monitoredqueue.py -> build/lib.linux-aarch64-2.7/zmq/devices
copying zmq/devices/proxydevice.py -> build/lib.linux-aarch64-2.7/zmq/devices
copying zmq/devices/basedevice.py -> build/lib.linux-aarch64-2.7/zmq/devices
copying zmq/devices/monitoredqueuedevice.py -> build/lib.linux-aarch64-2.7/zmq/devices
copying zmq/devices/init.py -> build/lib.linux-aarch64-2.7/zmq/devices
creating build/lib.linux-aarch64-2.7/zmq/sugar
copying zmq/sugar/frame.py -> build/lib.linux-aarch64-2.7/zmq/sugar
copying zmq/sugar/stopwatch.py -> build/lib.linux-aarch64-2.7/zmq/sugar
copying zmq/sugar/context.py -> build/lib.linux-aarch64-2.7/zmq/sugar
copying zmq/sugar/attrsettr.py -> build/lib.linux-aarch64-2.7/zmq/sugar
copying zmq/sugar/poll.py -> build/lib.linux-aarch64-2.7/zmq/sugar
copying zmq/sugar/socket.py -> build/lib.linux-aarch64-2.7/zmq/sugar
copying zmq/sugar/version.py -> build/lib.linux-aarch64-2.7/zmq/sugar
copying zmq/sugar/init.py -> build/lib.linux-aarch64-2.7/zmq/sugar
copying zmq/sugar/tracker.py -> build/lib.linux-aarch64-2.7/zmq/sugar
copying zmq/sugar/constants.py -> build/lib.linux-aarch64-2.7/zmq/sugar
creating build/lib.linux-aarch64-2.7/zmq/auth
copying zmq/auth/ioloop.py -> build/lib.linux-aarch64-2.7/zmq/auth
copying zmq/auth/init.py -> build/lib.linux-aarch64-2.7/zmq/auth
copying zmq/auth/thread.py -> build/lib.linux-aarch64-2.7/zmq/auth
copying zmq/auth/base.py -> build/lib.linux-aarch64-2.7/zmq/auth
copying zmq/auth/certs.py -> build/lib.linux-aarch64-2.7/zmq/auth
creating build/lib.linux-aarch64-2.7/zmq/backend
copying zmq/backend/init.py -> build/lib.linux-aarch64-2.7/zmq/backend
copying zmq/backend/select.py -> build/lib.linux-aarch64-2.7/zmq/backend
creating build/lib.linux-aarch64-2.7/zmq/backend/cffi
copying zmq/backend/cffi/_poll.py -> build/lib.linux-aarch64-2.7/zmq/backend/cffi
copying zmq/backend/cffi/context.py -> build/lib.linux-aarch64-2.7/zmq/backend/cffi
copying zmq/backend/cffi/socket.py -> build/lib.linux-aarch64-2.7/zmq/backend/cffi
copying zmq/backend/cffi/error.py -> build/lib.linux-aarch64-2.7/zmq/backend/cffi
copying zmq/backend/cffi/utils.py -> build/lib.linux-aarch64-2.7/zmq/backend/cffi
copying zmq/backend/cffi/_cffi.py -> build/lib.linux-aarch64-2.7/zmq/backend/cffi
copying zmq/backend/cffi/devices.py -> build/lib.linux-aarch64-2.7/zmq/backend/cffi
copying zmq/backend/cffi/init.py -> build/lib.linux-aarch64-2.7/zmq/backend/cffi
copying zmq/backend/cffi/message.py -> build/lib.linux-aarch64-2.7/zmq/backend/cffi
copying zmq/backend/cffi/constants.py -> build/lib.linux-aarch64-2.7/zmq/backend/cffi
creating build/lib.linux-aarch64-2.7/zmq/backend/cython
copying zmq/backend/cython/init.py -> build/lib.linux-aarch64-2.7/zmq/backend/cython
creating build/lib.linux-aarch64-2.7/zmq/utils
copying zmq/utils/constant_names.py -> build/lib.linux-aarch64-2.7/zmq/utils
copying zmq/utils/garbage.py -> build/lib.linux-aarch64-2.7/zmq/utils
copying zmq/utils/strtypes.py -> build/lib.linux-aarch64-2.7/zmq/utils
copying zmq/utils/interop.py -> build/lib.linux-aarch64-2.7/zmq/utils
copying zmq/utils/win32.py -> build/lib.linux-aarch64-2.7/zmq/utils
copying zmq/utils/sixcerpt.py -> build/lib.linux-aarch64-2.7/zmq/utils
copying zmq/utils/init.py -> build/lib.linux-aarch64-2.7/zmq/utils
copying zmq/utils/monitor.py -> build/lib.linux-aarch64-2.7/zmq/utils
copying zmq/utils/jsonapi.py -> build/lib.linux-aarch64-2.7/zmq/utils
copying zmq/utils/z85.py -> build/lib.linux-aarch64-2.7/zmq/utils
creating build/lib.linux-aarch64-2.7/zmq/ssh
copying zmq/ssh/forward.py -> build/lib.linux-aarch64-2.7/zmq/ssh
copying zmq/ssh/init.py -> build/lib.linux-aarch64-2.7/zmq/ssh
copying zmq/ssh/tunnel.py -> build/lib.linux-aarch64-2.7/zmq/ssh
creating build/lib.linux-aarch64-2.7/zmq/log
copying zmq/log/handlers.py -> build/lib.linux-aarch64-2.7/zmq/log
copying zmq/log/init.py -> build/lib.linux-aarch64-2.7/zmq/log
creating build/lib.linux-aarch64-2.7/zmq/tests
copying zmq/tests/test_decorators.py -> build/lib.linux-aarch64-2.7/zmq/tests
copying zmq/tests/test_auth.py -> build/lib.linux-aarch64-2.7/zmq/tests
copying zmq/tests/test_pair.py -> build/lib.linux-aarch64-2.7/zmq/tests
copying zmq/tests/test_reqrep.py -> build/lib.linux-aarch64-2.7/zmq/tests
copying zmq/tests/test_future.py -> build/lib.linux-aarch64-2.7/zmq/tests
copying zmq/tests/test_monitor.py -> build/lib.linux-aarch64-2.7/zmq/tests
copying zmq/tests/test_poll.py -> build/lib.linux-aarch64-2.7/zmq/tests
copying zmq/tests/test_error.py -> build/lib.linux-aarch64-2.7/zmq/tests
copying zmq/tests/test_draft.py -> build/lib.linux-aarch64-2.7/zmq/tests
copying zmq/tests/test_context.py -> build/lib.linux-aarch64-2.7/zmq/tests
copying zmq/tests/test_includes.py -> build/lib.linux-aarch64-2.7/zmq/tests
copying zmq/tests/test_ioloop.py -> build/lib.linux-aarch64-2.7/zmq/tests
copying zmq/tests/test_zmqstream.py -> build/lib.linux-aarch64-2.7/zmq/tests
copying zmq/tests/test_log.py -> build/lib.linux-aarch64-2.7/zmq/tests
copying zmq/tests/test_cffi_backend.py -> build/lib.linux-aarch64-2.7/zmq/tests
copying zmq/tests/test_socket.py -> build/lib.linux-aarch64-2.7/zmq/tests
copying zmq/tests/test_monqueue.py -> build/lib.linux-aarch64-2.7/zmq/tests
copying zmq/tests/test_win32_shim.py -> build/lib.linux-aarch64-2.7/zmq/tests
copying zmq/tests/init.py -> build/lib.linux-aarch64-2.7/zmq/tests
copying zmq/tests/test_version.py -> build/lib.linux-aarch64-2.7/zmq/tests
copying zmq/tests/test_retry_eintr.py -> build/lib.linux-aarch64-2.7/zmq/tests
copying zmq/tests/test_security.py -> build/lib.linux-aarch64-2.7/zmq/tests
copying zmq/tests/test_multipart.py -> build/lib.linux-aarch64-2.7/zmq/tests
copying zmq/tests/test_z85.py -> build/lib.linux-aarch64-2.7/zmq/tests
copying zmq/tests/test_message.py -> build/lib.linux-aarch64-2.7/zmq/tests
copying zmq/tests/test_imports.py -> build/lib.linux-aarch64-2.7/zmq/tests
copying zmq/tests/test_ssh.py -> build/lib.linux-aarch64-2.7/zmq/tests
copying zmq/tests/test_constants.py -> build/lib.linux-aarch64-2.7/zmq/tests
copying zmq/tests/test_pubsub.py -> build/lib.linux-aarch64-2.7/zmq/tests
copying zmq/tests/test_etc.py -> build/lib.linux-aarch64-2.7/zmq/tests
copying zmq/tests/test_device.py -> build/lib.linux-aarch64-2.7/zmq/tests
creating build/lib.linux-aarch64-2.7/zmq/eventloop
copying zmq/eventloop/_deprecated.py -> build/lib.linux-aarch64-2.7/zmq/eventloop
copying zmq/eventloop/zmqstream.py -> build/lib.linux-aarch64-2.7/zmq/eventloop
copying zmq/eventloop/ioloop.py -> build/lib.linux-aarch64-2.7/zmq/eventloop
copying zmq/eventloop/init.py -> build/lib.linux-aarch64-2.7/zmq/eventloop
copying zmq/eventloop/future.py -> build/lib.linux-aarch64-2.7/zmq/eventloop
creating build/lib.linux-aarch64-2.7/zmq/eventloop/minitornado
copying zmq/eventloop/minitornado/concurrent.py -> build/lib.linux-aarch64-2.7/zmq/eventloop/minitornado
copying zmq/eventloop/minitornado/log.py -> build/lib.linux-aarch64-2.7/zmq/eventloop/minitornado
copying zmq/eventloop/minitornado/ioloop.py -> build/lib.linux-aarch64-2.7/zmq/eventloop/minitornado
copying zmq/eventloop/minitornado/init.py -> build/lib.linux-aarch64-2.7/zmq/eventloop/minitornado
copying zmq/eventloop/minitornado/stack_context.py -> build/lib.linux-aarch64-2.7/zmq/eventloop/minitornado
copying zmq/eventloop/minitornado/util.py -> build/lib.linux-aarch64-2.7/zmq/eventloop/minitornado
creating build/lib.linux-aarch64-2.7/zmq/eventloop/minitornado/platform
copying zmq/eventloop/minitornado/platform/windows.py -> build/lib.linux-aarch64-2.7/zmq/eventloop/minitornado/platform
copying zmq/eventloop/minitornado/platform/init.py -> build/lib.linux-aarch64-2.7/zmq/eventloop/minitornado/platform
copying zmq/eventloop/minitornado/platform/auto.py -> build/lib.linux-aarch64-2.7/zmq/eventloop/minitornado/platform
copying zmq/eventloop/minitornado/platform/interface.py -> build/lib.linux-aarch64-2.7/zmq/eventloop/minitornado/platform
copying zmq/eventloop/minitornado/platform/common.py -> build/lib.linux-aarch64-2.7/zmq/eventloop/minitornado/platform
copying zmq/eventloop/minitornado/platform/posix.py -> build/lib.linux-aarch64-2.7/zmq/eventloop/minitornado/platform
copying zmq/devices/monitoredqueue.pxd -> build/lib.linux-aarch64-2.7/zmq/devices
copying zmq/backend/cffi/_cdefs.h -> build/lib.linux-aarch64-2.7/zmq/backend/cffi
copying zmq/backend/cffi/_verify.c -> build/lib.linux-aarch64-2.7/zmq/backend/cffi
copying zmq/backend/cython/socket.pxd -> build/lib.linux-aarch64-2.7/zmq/backend/cython
copying zmq/backend/cython/checkrc.pxd -> build/lib.linux-aarch64-2.7/zmq/backend/cython
copying zmq/backend/cython/context.pxd -> build/lib.linux-aarch64-2.7/zmq/backend/cython
copying zmq/backend/cython/message.pxd -> build/lib.linux-aarch64-2.7/zmq/backend/cython
copying zmq/backend/cython/libzmq.pxd -> build/lib.linux-aarch64-2.7/zmq/backend/cython
copying zmq/backend/cython/constants.pxi -> build/lib.linux-aarch64-2.7/zmq/backend/cython
copying zmq/backend/cython/constant_enums.pxi -> build/lib.linux-aarch64-2.7/zmq/backend/cython
copying zmq/utils/buffers.pxd -> build/lib.linux-aarch64-2.7/zmq/utils
copying zmq/utils/pyversion_compat.h -> build/lib.linux-aarch64-2.7/zmq/utils
copying zmq/utils/zmq_compat.h -> build/lib.linux-aarch64-2.7/zmq/utils
copying zmq/utils/zmq_constants.h -> build/lib.linux-aarch64-2.7/zmq/utils
copying zmq/utils/ipcmaxlen.h -> build/lib.linux-aarch64-2.7/zmq/utils
copying zmq/utils/getpid_compat.h -> build/lib.linux-aarch64-2.7/zmq/utils
copying zmq/utils/mutex.h -> build/lib.linux-aarch64-2.7/zmq/utils
running build_ext
running configure
Did not find libzmq via pkg-config.
{'libraries': ['zmq'], 'extra_link_args': [], 'runtime_library_dirs': [], 'library_dirs': [], 'include_dirs': []}
aarch64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fno-strict-aliasing -Wdate-time -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security -fPIC -c build/temp.linux-aarch64-2.7/scratch/check_sys_un.c -o build/temp.linux-aarch64-2.7/scratch/check_sys_un.o
aarch64-linux-gnu-gcc -pthread build/temp.linux-aarch64-2.7/scratch/check_sys_un.o -o build/temp.linux-aarch64-2.7/scratch/check_sys_un
************************************************
Configure: Autodetecting ZMQ settings...
Custom ZMQ dir:
creating build/temp.linux-aarch64-2.7/scratch/tmp
cc -c /tmp/timer_createUDjT0t.c -o build/temp.linux-aarch64-2.7/scratch/tmp/timer_createUDjT0t.o
/tmp/timer_createUDjT0t.c:1:1: warning: return type defaults to ‘int’ [-Wimplicit-int]
main (int argc, char **argv) {
^
/tmp/timer_createUDjT0t.c: In function ‘main’:
/tmp/timer_createUDjT0t.c:2:5: warning: implicit declaration of function ‘timer_create’ [-Wimplicit-function-declaration]
timer_create();
^
cc build/temp.linux-aarch64-2.7/scratch/tmp/timer_createUDjT0t.o -o build/temp.linux-aarch64-2.7/scratch/a.out
build/temp.linux-aarch64-2.7/scratch/tmp/timer_createUDjT0t.o: In function main': timer_createUDjT0t.c:(.text+0x10): undefined reference to timer_create'
collect2: error: ld returned 1 exit status
aarch64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fno-strict-aliasing -Wdate-time -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security -fPIC -Izmq/utils -Izmq/backend/cython -Izmq/devices -c build/temp.linux-aarch64-2.7/scratch/vers.c -o build/temp.linux-aarch64-2.7/scratch/vers.o
build/temp.linux-aarch64-2.7/scratch/vers.c:4:17: fatal error: zmq.h: No such file or directory
compilation terminated.

error: command 'aarch64-linux-gnu-gcc' failed with exit status 1

Failed with default libzmq, trying again with /usr/local
{'libraries': ['zmq'], 'extra_link_args': [], 'runtime_library_dirs': ['/usr/local/lib'], 'library_dirs': ['/usr/local/lib'], 'include_dirs': ['/usr/local/include']}
************************************************
Configure: Autodetecting ZMQ settings...
    Custom ZMQ dir:       /usr/local
cc -c /tmp/timer_createZ4irn5.c -o build/temp.linux-aarch64-2.7/scratch/tmp/timer_createZ4irn5.o
/tmp/timer_createZ4irn5.c:1:1: warning: return type defaults to ‘int’ [-Wimplicit-int]
 main (int argc, char **argv) {
 ^
/tmp/timer_createZ4irn5.c: In function ‘main’:
/tmp/timer_createZ4irn5.c:2:5: warning: implicit declaration of function ‘timer_create’ [-Wimplicit-function-declaration]
     timer_create();
     ^
Assembler messages:
Fatal error: can't create build/temp.linux-aarch64-2.7/scratch/tmp/timer_createZ4irn5.o: No such file or directory
aarch64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fno-strict-aliasing -Wdate-time -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security -fPIC -I/usr/local/include -Izmq/utils -Izmq/backend/cython -Izmq/devices -c build/temp.linux-aarch64-2.7/scratch/vers.c -o build/temp.linux-aarch64-2.7/scratch/vers.o
build/temp.linux-aarch64-2.7/scratch/vers.c:4:17: fatal error: zmq.h: No such file or directory
compilation terminated.

error: command 'aarch64-linux-gnu-gcc' failed with exit status 1

************************************************
Warning: Couldn't find an acceptable libzmq on the system.

If you expected pyzmq to link against an installed libzmq, please check to make sure:

    * You have a C compiler installed
    * A development version of Python is installed (including headers)
    * A development version of ZMQ >= 3.2 is installed (including headers)
    * If ZMQ is not in a default location, supply the argument --zmq=<path>
    * If you did recently install ZMQ to a default location,
      try rebuilding the ld cache with `sudo ldconfig`
      or specify zmq's location with `--zmq=/usr/local`

You can skip all this detection/waiting nonsense if you know
you want pyzmq to bundle libzmq as an extension by passing:

    `--zmq=bundled`

I will now try to build libzmq as a Python extension
unless you interrupt me (^C) in the next 10 seconds...

 1...
************************************************
Using bundled libzmq
already have bundled/zeromq
attempting ./configure to generate platform.hpp
Warning: failed to configure libzmq:
/bin/sh: 1: ./configure: not found

staging platform.hpp from: buildutils/include_linux
************************************************
checking for timer_create
creating build/temp.linux-aarch64-2.7/tmp
cc -c /tmp/timer_createUuMQRv.c -o build/temp.linux-aarch64-2.7/tmp/timer_createUuMQRv.o
/tmp/timer_createUuMQRv.c:1:1: warning: return type defaults to ‘int’ [-Wimplicit-int]
 main (int argc, char **argv) {
 ^
/tmp/timer_createUuMQRv.c: In function ‘main’:
/tmp/timer_createUuMQRv.c:2:5: warning: implicit declaration of function ‘timer_create’ [-Wimplicit-function-declaration]
     timer_create();
     ^
cc build/temp.linux-aarch64-2.7/tmp/timer_createUuMQRv.o -o build/temp.linux-aarch64-2.7/a.out
build/temp.linux-aarch64-2.7/tmp/timer_createUuMQRv.o: In function `main':
timer_createUuMQRv.c:(.text+0x10): undefined reference to `timer_create'
collect2: error: ld returned 1 exit status
no timer_create, linking librt
************************************************
building 'zmq.libzmq' extension
creating build/temp.linux-aarch64-2.7/buildutils
creating build/temp.linux-aarch64-2.7/bundled
creating build/temp.linux-aarch64-2.7/bundled/zeromq
creating build/temp.linux-aarch64-2.7/bundled/zeromq/src
aarch64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fno-strict-aliasing -Wdate-time -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security -fPIC -DZMQ_HAVE_CURVE=1 -DZMQ_USE_TWEETNACL=1 -DZMQ_USE_EPOLL=1 -Ibundled/zeromq/include -Ibundled -I/usr/include/python2.7 -c buildutils/initlibzmq.c -o build/temp.linux-aarch64-2.7/buildutils/initlibzmq.o
aarch64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fno-strict-aliasing -Wdate-time -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security -fPIC -DZMQ_HAVE_CURVE=1 -DZMQ_USE_TWEETNACL=1 -DZMQ_USE_EPOLL=1 -Ibundled/zeromq/include -Ibundled -I/usr/include/python2.7 -c bundled/zeromq/src/router.cpp -o build/temp.linux-aarch64-2.7/bundled/zeromq/src/router.o
cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for C/ObjC but not for C++
In file included from bundled/zeromq/src/options.hpp:38:0,
                 from bundled/zeromq/src/own.hpp:37,
                 from bundled/zeromq/src/socket_base.hpp:37,
                 from bundled/zeromq/src/router.hpp:35,
                 from bundled/zeromq/src/router.cpp:32:
bundled/zeromq/src/atomic_ptr.hpp: In member function ‘int zmq::atomic_value_t::load() const’:
bundled/zeromq/src/atomic_ptr.hpp:269:46: error: binding ‘const zmq::mutex_t’ to reference of type ‘zmq::mutex_t&’ discards qualifiers
                                              sync
                                              ^
bundled/zeromq/src/atomic_ptr.hpp:116:14: note:   initializing argument 4 of ‘void* zmq::atomic_cas(void* volatile*, void*, void*, zmq::mutex_t&)’
 inline void *atomic_cas (void *volatile *ptr_,
              ^
error: command 'aarch64-linux-gnu-gcc' failed with exit status 1

---------------------------------------

Command "/usr/bin/python -u -c "import setuptools, tokenize;file='/tmp/pip-install-F64xGG/pyzmq/setup.py';f=getattr(tokenize, 'open', open)(file);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, file, 'exec'))" install --record /tmp/pip-record-1UyN3n/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-install-F64xGG/pyzmq/

how to install jupyter notebook in jetson TX2?

Thanks for taking the time to read it! have a nice day~

make error

when I run the "make" command, it raises an error:

[ 36%] Built target jetson-utils
[ 38%] Linking CXX shared library aarch64/lib/libjetson-reinforcement.so
/usr/bin/ld: cannot find -l_C
collect2: error: ld returned 1 exit status
CMakeFiles/jetson-reinforcement.dir/build.make:322: recipe for target 'aarch64/lib/libjetson-reinforcement.so' failed
make[2]: *** [aarch64/lib/libjetson-reinforcement.so] 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

I found that there was a file named "lib_C.so" in "pytorch/torch/", and I check the proporpties, the type was "Link (broken) (inode/symlink)".
What's wrong with it ? Thank you!

How to install conda in TX2?

I run into incompatibility errors while attempting to install conda in TX2. Are there any documentations for installation procedure?

Error running the Gazebo Arm example

CMake and make run fine. But on running ./gazebo-arm.sh, the arm in Gazebo just keeps falling loosely(as in the GIF).

image

I'm running this on Nvidia 940MX on Ubuntu 16.04.

ArmPlugin::ArmPlugin()
ArmPlugin::Load('arm')
PropPlugin::Load('tube')
[deepRL]  use_cuda:       True
[deepRL]  use_lstm:       1
[deepRL]  lstm_size:      512
[deepRL]  input_width:    64
[deepRL]  input_height:   64
[deepRL]  input_channels: 3
[deepRL]  num_actions:    4
[deepRL]  optimizer:      RMSprop
[deepRL]  learning rate:  1.5
[deepRL]  replay_memory:  10000
[deepRL]  batch_size:     2
[deepRL]  gamma:          0.9
[deepRL]  epsilon_start:  0.9
[deepRL]  epsilon_end:    0.05
[deepRL]  epsilon_decay:  200.0
[deepRL]  allow_random:   1
[deepRL]  debug_mode:     1
[deepRL]  creating DQN model instance
[deepRL]  DRQN::__init__()
[deepRL]  LSTM (hx, cx) size = 512
[deepRL]  DQN model instance created
[deepRL]  DQN script done init
[cuda]  cudaAllocMapped 49152 bytes, CPU 0x203960000 GPU 0x203960000
[deepRL]  pyTorch THCState  0x40AA9C00
[cuda]  cudaAllocMapped 12288 bytes, CPU 0x203a60000 GPU 0x203a60000
ArmPlugin - allocated camera img buffer 64x64  24 bpp  12288 bytes
episode frame = 1
[cuda]   cudaGetLastError()
[cuda]      no kernel image is available for execution on the device (error 48) (hex 0x30)
[cuda]      /home/shivangg/projects/catkin_ws/src/RoboND-DeepRL-Project/cuda/cudaPlanar.cu:53
[cuda]   cudaPackedToPlanarBGR((uchar3*)inputBuffer[1], inputRawWidth, inputRawHeight, inputState->gpuPtr, 64, 64)
[cuda]      no kernel image is available for execution on the device (error 48) (hex 0x30)
[cuda]      /home/shivangg/projects/catkin_ws/src/RoboND-DeepRL-Project/gazebo/ArmPlugin.cpp:322
ArmPlugin - failed to convert 64x64 image to 64x64 planar BGR image

Building from Source fails

I followed the following iinstruction, but it fales at $ cmake ../

$ sudo apt-get install cmake
$ git clone http://github.com/dusty-nv/jetson-reinforcement
$ cd jetson-reinforcement
$ git submodule update --init
$ mkdir build
$ cd build
$ cmake ../
$ make

I am using Nano and Jetpack 4.4.
I did twice as follows:

  1. flash SD Card
  2. initial Ubuntu setup
  3. Directly perform the above instruction.

Both failed with the same error. Thus, Pytorch is not installed. Please see the CMake error and output log files.

I really want to make this works.

Thanks!

CMakeError.log
CMakeOutput.log

Issue compiling in Jetson TX2

Hi @dusty-nv ,
I am having the following issue compiling this project in the Jetson :

/home/nvidia/Deep-RL-Arm-Manipulation/c/pyTorch.h:14:19: fatal error: TH/TH.h: No such file or directory
compilation terminated.
CMakeFiles/jetson-reinforcement.dir/build.make:93: 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' 

Thanks,
Bruno

Error Jetson nano to launch gym-DQN.py

I make jetson-reinfocement and launch gym-DQN.py and Error occur below... plz help me..

$ python3 gym-DQN.py

[2019-05-11 02:24:18,666] Making new env: CartPole-v0
/usr/local/lib/python3.6/dist-packages/gym/envs/registration.py:17: PkgResourcesDeprecationWarning: Parameters to load are deprecated. Call .resolve and .require separately.
result = entry_point.load(False)
/usr/local/lib/python3.6/dist-packages/torchvision-0.2.3a0+50d54a8-py3.6-linux-aarch64.egg/torchvision/transforms/transforms.py:209: UserWarning: The use of the transforms.Scale transform is deprecated, please use transforms.Resize instead.
Segmentation fault (core dumped)

run "./gazebo-arm.sh", error raised, "This program requires version 3.5.0 of the Protocol Buffer runtime library"

The project can complied completely, but when I run this "gazebo-arm.sh" or "gazebo-rover.sh" in the command line, it got errors. When I run "gazebo-arm.sh", it print the error bellow.
And then I removed protobuf(2.6.1), and installed a protobuf(version 3.5.0), the project couldn't make well, that gazebo7 use protobuf (2.6.1), so I remove protobuf(3.5.0), and re-installed protobuf(2.6.1). The error still exists. I don't really know where got the error This program requires version 3.5.0, which program use "3.5.0"? Do someone meet this error?

Thank you!

  • error---------------------------------------------

configuring Gazebo7 plugin paths
previous GAZEBO_PLUGIN_PATH=
./gazebo-arm.sh: 6: ./gazebo-arm.sh: Bad substitution
script directory /home/nvidia/X/jetson/jetson-reinforcement/build/aarch64/bin
plugin path /home/nvidia/X/jetson/jetson-reinforcement/build/aarch64/bin/../lib
GAZEBO_PLUGIN_PATH=/home/nvidia/X/jetson/jetson-reinforcement/build/aarch64/bin/../lib:

starting Gazebo7 Client (gzclient)
starting Gazebo7 Server (gzserver)

Gazebo multi-robot simulator, version 7.0.0
Copyright (C) 2012-2016 Open Source Robotics Foundation.
Released under the Apache 2 License.
http://gazebosim.org

[Msg] Waiting for master.
[Msg] Connected to gazebo master @ http://127.0.0.1:11345
[Msg] Publicized address: 169.254.10.203
ArmPlugin::ArmPlugin()
ArmPlugin::Load('arm')
[deepRL] use_cuda: True
[deepRL] use_lstm: 1
[deepRL] lstm_size: 256
[deepRL] input_width: 64
[deepRL] input_height: 64
[deepRL] input_channels: 3
[deepRL] num_actions: 6
[deepRL] optimizer: RMSprop
[deepRL] learning rate: 0.1
[deepRL] replay_memory: 10000
[deepRL] batch_size: 32
[deepRL] gamma: 0.9
[deepRL] epsilon_start: 0.9
[deepRL] epsilon_end: 0.05
[deepRL] epsilon_decay: 200.0
[deepRL] allow_random: 1
[deepRL] debug_mode: 0
[deepRL] creating DQN model instance
[deepRL] DRQN::init()
[deepRL] LSTM (hx, cx) size = 256
[deepRL] DQN model instance created
[deepRL] DQN script done init
[cuda] cudaAllocMapped 49152 bytes, CPU 0x101340000 GPU 0x101340000
[deepRL] pyTorch THCState 0x40E53120
[libprotobuf FATAL google/protobuf/stubs/common.cc:61] This program requires version 3.5.0 of the Protocol Buffer runtime library, but the installed version is 2.6.1. Please update your library. If you compiled the program yourself, make sure that your headers are from the same version of Protocol Buffers as your link-time library. (Version verification failed in "google/protobuf/any.pb.cc".)
terminate called after throwing an instance of 'google::protobuf::FatalException'
what(): This program requires version 3.5.0 of the Protocol Buffer runtime library, but the installed version is 2.6.1. Please update your library. If you compiled the program yourself, make sure that your headers are from the same version of Protocol Buffers as your link-time library. (Version verification failed in "google/protobuf/any.pb.cc".)

Aborted (core dumped)
Gazebo7 Server (gzserver) has exited.

OSE ERrror with BipedalWalker After correctly running

Hi,
I runned two lines
$ cd jetson-reinforcement/python/A3G
$ python main.py --env BipedalWalkerHardcore-v2 --workers 8 --gpu-ids 0 --amsgrad True --model CONV --stack-frames 4

After correctly running 3 hours, I closed and at time same time,
img_8418
I get the error in figure.

What is error? In new terinal,
I tried the two same lines, it gives same error without main.py window.

Many thanks

Error with Jetson Nano

When doing a make, I got this error on Jetson Nano.

Scanning dependencies of target jetson-reinforcement
[ 40%] Building CXX object CMakeFiles/jetson-reinforcement.dir/c/aiAgent.cpp.o
[ 42%] Building CXX object CMakeFiles/jetson-reinforcement.dir/c/dqnAgent.cpp.o
[ 44%] Building CXX object CMakeFiles/jetson-reinforcement.dir/c/pyTensor.cpp.o
In file included from /home/jetbot/jetson-reinforcement/c/pyTensor.cpp:6:0:
/home/jetbot/jetson-reinforcement/c/pyTorch.h:15:10: fatal error: THC/THC.h: No such file or directory
#include <THC/THC.h>
^~~~~~~~~~~
compilation terminated.
CMakeFiles/jetson-reinforcement.dir/build.make:117: recipe for target 'CMakeFiles/jetson-reinforcement.dir/c/pyTensor.cpp.o' failed
make[2]: *** [CMakeFiles/jetson-reinforcement.dir/c/pyTensor.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
jetbot@jetbot:~/jetson-reinforcement/build$

Supported platform

It seems both Jetson TX1 and TX2 have reached EOL. What is a suitable platform to try this out.

I was trying to get Nano to work but I kept running into issues. Getting Juypter to installed, getting pytorch to work, not sure with which version of python, and other build error with invalid syntax, etc.

Any suggestions and recommendation on how to test out the reinforcement demo? Or may be provide instructions on how to get this on the nano?

Thanks.

NT

deepRL-console (python)

Hello~
I'm trying to build torch on TX2.
When I try to verify lua + torch install,
I have the problem like this
screenshot from 2017-06-12 22-38-18
How can I do ?
Thank you

Error running catch executable

Hi @dusty-nv ,
First, thanks for this amazing project.
I am running this project on a Jetson TX2 Ubuntu 16.04.
While running catch executable I got the folllowing message:


[deepRL]  use_cuda:       True
[deepRL]  use_lstm:       1
[deepRL]  lstm_size:      256
[deepRL]  input_width:    64
[deepRL]  input_height:   64
[deepRL]  input_channels: 1
[deepRL]  num_actions:    3
[deepRL]  optimizer:      RMSprop
[deepRL]  learning rate:  0.01
[deepRL]  replay_memory:  10000
[deepRL]  batch_size:     32
[deepRL]  gamma:          0.9
[deepRL]  epsilon_start:  0.9
[deepRL]  epsilon_end:    0.05
[deepRL]  epsilon_decay:  200.0
[deepRL]  allow_random:   1
[deepRL]  debug_mode:     0
[deepRL]  creating DQN model instance
[deepRL]  DRQN::__init__()
terminate called after throwing an instance of 'std::out_of_range'
  what():  _Map_base::at
Aborted (core dumped)

What could be the issue ?
Thanks,

cmake ../

I tried jetson-reinforcement on my new jetson tx2. It has Tegra R28.1.I have not installed a new jetpack version or the new software yet.

However i received some errors. what is the errors

Can I use jetson-reinforcement together with Tegra R28.1

thanks

nvidia@tegra-ubuntu:~/jetson-reinforcement/build$ cmake ../
CUDA_TOOLKIT_ROOT_DIR not found or specified
-- Could NOT find CUDA (missing: CUDA_TOOLKIT_ROOT_DIR CUDA_NVCC_EXECUTABLE CUDA_INCLUDE_DIRS CUDA_CUDART_LIBRARY)
-- system arch: aarch64
-- output path: /home/nvidia/jetson-reinforcement/build/aarch64
-- nvcuda path: CUDA_TOOLKIT_ROOT_DIR-NOTFOUND
CMake Warning (dev) at CMakeLists.txt:68 (link_directories):
This command specifies the relative path

CUDA_TOOLKIT_ROOT_DIR-NOTFOUND/lib64

as a link directory.

Policy CMP0015 is not set: link_directories() treats paths relative to the
source dir. Run "cmake --help-policy CMP0015" for policy details. Use the
cmake_policy command to set the policy and suppress this warning.
This warning is for project developers. Use -Wno-dev to suppress it.

-- Copying /home/nvidia/jetson-reinforcement/c/deepRL.h
-- Copying /home/nvidia/jetson-reinforcement/c/rlAgent.h
-- Copying /home/nvidia/jetson-reinforcement/c/dqnAgent.h
-- Copying /home/nvidia/jetson-reinforcement/c/aiAgent.h
-- Copying /home/nvidia/jetson-reinforcement/c/pyTensor.h
-- Copying /home/nvidia/jetson-reinforcement/c/pyTorch.h
-- Copying /home/nvidia/jetson-reinforcement/cuda/cudaPlanar.h
-- Copying /home/nvidia/jetson-reinforcement/python/gym-actorCritic.py
-- Copying /home/nvidia/jetson-reinforcement/python/RL.py
-- Copying /home/nvidia/jetson-reinforcement/python/test-torch.py
-- Copying /home/nvidia/jetson-reinforcement/python/test-interop.py
-- Copying /home/nvidia/jetson-reinforcement/python/gym-DQN.py
-- Copying /home/nvidia/jetson-reinforcement/python/gym-RL.py
-- Copying /home/nvidia/jetson-reinforcement/python/DQN.py
-- Copying /home/nvidia/jetson-reinforcement/python/intro-DQN.ipynb
-- Copying /home/nvidia/jetson-reinforcement/python/intro-pytorch.ipynb
CMake Warning at /usr/share/cmake-3.5/Modules/FindBoost.cmake:725 (message):
Imported targets not available for Boost version
Call Stack (most recent call first):
/usr/share/cmake-3.5/Modules/FindBoost.cmake:763 (_Boost_COMPONENT_DEPENDENCIES)
/usr/share/cmake-3.5/Modules/FindBoost.cmake:1332 (_Boost_MISSING_DEPENDENCIES)
gazebo/CMakeLists.txt:5 (find_package)

CMake Error at /usr/share/cmake-3.5/Modules/FindBoost.cmake:1677 (message):
Unable to find the requested Boost libraries.

Unable to find the Boost header files. Please set BOOST_ROOT to the root
directory containing Boost or BOOST_INCLUDEDIR to the directory containing
Boost's headers.
Call Stack (most recent call first):
gazebo/CMakeLists.txt:5 (find_package)

-- Checking for module 'gazebo'
-- No package 'gazebo' found
-- jetson-utils: building as submodule, /home/nvidia/jetson-reinforcement

'Failed to load function from bytecode:' Error while loading model file

Hi,

So i'm currently trying to load a network model via torch on an Nvidia TX1. When I try to load the model

net = torch.load('modelfile.t7','ascii')

I get the following error:

bytecode-error

The model loads fine on my Ubuntu 14.04 desktop, so I tried loading the same model, converting it to binary and then trying to load the converted file

net = torch.load('modelfile.bin')

But i still get a similar error:

binary_error_model

I've noticed that a few people have had the same errors in the past but most people seem to have been able to get past this by using an 'ascii' version of the model since it's platform independent (?). I seem to have had no luck with that. The other set of individuals who faced this problem were on a 32bit system. But my Nvidia TX1 is currently running on Ubuntu 16.04 (64bit).

For anyone willing to recreate these results:

I installed JetPack (JetPack-L4T-2.3.1-linux-x64.run) and verified that my installation of CUDA 8.0 and OpenCV is functional.

For Torch, I used your installation script
https://github.com/dusty-nv/jetson-reinforcement
The installation script in particular is https://github.com/dusty-nv/jetson-reinforcement/blob/master/CMakePreBuild.sh
It all looks pretty straightforward.

And this is the code that i'm trying to run on the TX1
https://github.com/jzbontar/mc-cnn
The model file in specific is https://s3.amazonaws.com/mc-cnn/net_kitti_fast_-a_train_all.t7

Any tips on how to fix this problem is gladly appreciated. If anyone has any ideas on how I can tweak the model on my desktop machine to make it work here I'd love to hear it too.

I know this doesn't sit perfectly well as an issue regarding this repository but I was hoping you'd have some idea on what might be causing this error.

Thanks in advance,

Shreyas

When I make this code , there is some err that I can not work it out .

I use tx1 and follow the 8 steps, but failed. 16G is enough for this project?
First time , I get the note like this

You are using pip version 9.0.1, however version 10.0.1 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.

so ,I use "pip install torch torchvision" to update ,from https://pytorch.org/

Second time, the cmake step looks googd

-- Found Qt4: /usr/bin/qmake-qt4 (found version "4.8.7")
-- Copying /home/ubuntu/jetson-reinforcement/utils/loadImage.h
-- Copying /home/ubuntu/jetson-reinforcement/utils/rand.h
-- Copying /home/ubuntu/jetson-reinforcement/utils/pi.h
-- Copying /home/ubuntu/jetson-reinforcement/utils/commandLine.h
-- Copying /home/ubuntu/jetson-reinforcement/utils/camera/v4l2Camera.h
-- Copying /home/ubuntu/jetson-reinforcement/utils/camera/gstUtility.h
-- Copying /home/ubuntu/jetson-reinforcement/utils/camera/gstCamera.h
-- Copying /home/ubuntu/jetson-reinforcement/utils/cuda/cudaOverlay.h
-- Copying /home/ubuntu/jetson-reinforcement/utils/cuda/cudaRGB.h
-- Copying /home/ubuntu/jetson-reinforcement/utils/cuda/cudaNormalize.h
-- Copying /home/ubuntu/jetson-reinforcement/utils/cuda/cudaResize.h
-- Copying /home/ubuntu/jetson-reinforcement/utils/cuda/cudaFont.h
-- Copying /home/ubuntu/jetson-reinforcement/utils/cuda/cudaMappedMemory.h
-- Copying /home/ubuntu/jetson-reinforcement/utils/cuda/cudaUtility.h
-- Copying /home/ubuntu/jetson-reinforcement/utils/cuda/cudaYUV.h
-- Copying /home/ubuntu/jetson-reinforcement/utils/display/glTexture.h
-- Copying /home/ubuntu/jetson-reinforcement/utils/display/glDisplay.h
-- Copying /home/ubuntu/jetson-reinforcement/utils/display/glUtility.h
-- Copying /home/ubuntu/jetson-reinforcement/utils/input/devJoystick.h
-- Copying /home/ubuntu/jetson-reinforcement/utils/input/devInput.h
-- Copying /home/ubuntu/jetson-reinforcement/utils/input/devKeyboard.h
-- Copying /home/ubuntu/jetson-reinforcement/utils/data/fontmapA.png
-- Copying /home/ubuntu/jetson-reinforcement/utils/data/fontmapB.png
-- Configuring done
-- Generating done
-- Build files have been written to: /home/ubuntu/jetson-reinforcement/build

so I think I can make it
ubuntu@tegra-ubuntu:~/jetson-reinforcement/build$ make

but ,some thing wrong showed up , and I not sure what should do next.

-- Build files have been written to: /home/ubuntu/jetson-reinforcement/build/pytorch/torch/lib/build/THC
[ 3%] Building NVCC (Device) object CMakeFiles/THC.dir/THC_generated_THCHalf.cu.o
[ 3%] Building NVCC (Device) object CMakeFiles/THC.dir/THC_generated_THCBlas.cu.o
[ 3%] Building NVCC (Device) object CMakeFiles/THC.dir/THC_generated_THCReduceApplyUtils.cu.o
[ 4%] Building NVCC (Device) object CMakeFiles/THC.dir/THC_generated_THCSleep.cu.o
[ 6%] Building NVCC (Device) object CMakeFiles/THC.dir/THC_generated_THCStorage.cu.o
[ 7%] Building NVCC (Device) object CMakeFiles/THC.dir/THC_generated_THCStorageCopy.cu.o
[ 8%] Building NVCC (Device) object CMakeFiles/THC.dir/THC_generated_THCTensor.cu.o
[ 9%] Building NVCC (Device) object CMakeFiles/THC.dir/THC_generated_THCTensorCopy.cu.o
[ 10%] Building NVCC (Device) object CMakeFiles/THC.dir/THC_generated_THCTensorMath.cu.o
/home/ubuntu/jetson-reinforcement/build/pytorch/torch/lib/THC/THCNumerics.cuh(38): warning: integer conversion resulted in a change of sign

/home/ubuntu/jetson-reinforcement/build/pytorch/torch/lib/THC/THCNumerics.cuh(38): warning: integer conversion resulted in a change of sign

/home/ubuntu/jetson-reinforcement/build/pytorch/torch/lib/THC/THCNumerics.cuh(38): warning: integer conversion resulted in a change of sign

[ 12%] Building NVCC (Device) object CMakeFiles/THC.dir/THC_generated_THCTensorMath2.cu.o
/home/ubuntu/jetson-reinforcement/build/pytorch/torch/lib/THC/THCNumerics.cuh(38): warning: integer conversion resulted in a change of sign

/home/ubuntu/jetson-reinforcement/build/pytorch/torch/lib/THC/THCNumerics.cuh(38): warning: integer conversion resulted in a change of sign

[ 13%] Building NVCC (Device) object CMakeFiles/THC.dir/THC_generated_THCTensorMathBlas.cu.o
/home/ubuntu/jetson-reinforcement/build/pytorch/torch/lib/THC/THCNumerics.cuh(38): warning: integer conversion resulted in a change of sign

/home/ubuntu/jetson-reinforcement/build/pytorch/torch/lib/THC/THCNumerics.cuh(38): warning: integer conversion resulted in a change of sign

/home/ubuntu/jetson-reinforcement/build/pytorch/torch/lib/THC/THCNumerics.cuh(38): warning: integer conversion resulted in a change of sign

[ 14%] Building NVCC (Device) object CMakeFiles/THC.dir/THC_generated_THCTensorMathMagma.cu.o
[ 15%] Building NVCC (Device) object CMakeFiles/THC.dir/THC_generated_THCTensorMathPairwise.cu.o
[ 17%] Building NVCC (Device) object CMakeFiles/THC.dir/THC_generated_THCTensorMathReduce.cu.o
/home/ubuntu/jetson-reinforcement/build/pytorch/torch/lib/THC/THCNumerics.cuh(38): warning: integer conversion resulted in a change of sign

/home/ubuntu/jetson-reinforcement/build/pytorch/torch/lib/THC/THCNumerics.cuh(38): warning: integer conversion resulted in a change of sign

/home/ubuntu/jetson-reinforcement/build/pytorch/torch/lib/THC/THCNumerics.cuh(38): warning: integer conversion resulted in a change of sign

/home/ubuntu/jetson-reinforcement/build/pytorch/torch/lib/THC/THCNumerics.cuh(38): warning: integer conversion resulted in a change of sign

[ 18%] Building NVCC (Device) object CMakeFiles/THC.dir/THC_generated_THCTensorMathScan.cu.o
[ 19%] Building NVCC (Device) object CMakeFiles/THC.dir/THC_generated_THCTensorIndex.cu.o
/home/ubuntu/jetson-reinforcement/build/pytorch/torch/lib/THC/THCNumerics.cuh(38): warning: integer conversion resulted in a change of sign

/home/ubuntu/jetson-reinforcement/build/pytorch/torch/lib/THC/THCNumerics.cuh(38): warning: integer conversion resulted in a change of sign

/home/ubuntu/jetson-reinforcement/build/pytorch/torch/lib/THC/THCNumerics.cuh(38): warning: integer conversion resulted in a change of sign

/home/ubuntu/jetson-reinforcement/build/pytorch/torch/lib/THC/THCNumerics.cuh(38): warning: integer conversion resulted in a change of sign

/usr/local/cuda/include/thrust/detail/tuple.inl(248) (col. 8): catastrophic error: error while writing generated C file: No space left on device

1 catastrophic error detected in the compilation of "/tmp/tmpxft_000030b5_00000000-9_THCTensorIndex.cpp2.i".
Compilation terminated.
CMake Error at THC_generated_THCTensorIndex.cu.o.cmake:267 (message):
Error generating file
/home/ubuntu/jetson-reinforcement/build/pytorch/torch/lib/build/THC/CMakeFiles/THC.dir//./THC_generated_THCTensorIndex.cu.o

CMakeFiles/THC.dir/build.make:161: recipe for target 'CMakeFiles/THC.dir/THC_generated_THCTensorIndex.cu.o' failed
make[2]: *** [CMakeFiles/THC.dir/THC_generated_THCTensorIndex.cu.o] Error 1
make[2]: *** Waiting for unfinished jobs....
In file included from tmpxft_00002ed5_00000000-4_THCTensorCopy.cudafe1.stub.c:1:0:
/tmp/tmpxft_00002ed5_00000000-4_THCTensorCopy.cudafe1.stub.c:3548:27: fatal error: error writing to /tmp/ccx0ZMYE.s: No space left on device
compilation terminated.
CMake Error at THC_generated_THCTensorCopy.cu.o.cmake:267 (message):
Error generating file
/home/ubuntu/jetson-reinforcement/build/pytorch/torch/lib/build/THC/CMakeFiles/THC.dir//./THC_generated_THCTensorCopy.cu.o

CMakeFiles/THC.dir/build.make:105: recipe for target 'CMakeFiles/THC.dir/THC_generated_THCTensorCopy.cu.o' failed
make[2]: *** [CMakeFiles/THC.dir/THC_generated_THCTensorCopy.cu.o] Error 1
CMakeFiles/Makefile2:67: recipe for target 'CMakeFiles/THC.dir/all' failed
make[1]: *** [CMakeFiles/THC.dir/all] Error 2
Makefile:127: recipe for target 'all' failed
make: *** [all] Error 2
running develop
-- Building version 0.3.0b0+af3964a
running egg_info

Many .h files were labled" No such file or directory"
ubuntu@tegra-ubuntu:~/jetson-reinforcement/build$ make
[ 36%] Built target jetson-utils
[ 38%] Building CXX object CMakeFiles/jetson-reinforcement.dir/c/rlAgent.cpp.o
In file included from /home/ubuntu/jetson-reinforcement/build/pytorch/torch/csrc/THP.h:7:0,
from /home/ubuntu/jetson-reinforcement/c/pyTorch.h:16,
from /home/ubuntu/jetson-reinforcement/c/rlAgent.cpp:6:
/home/ubuntu/jetson-reinforcement/build/pytorch/torch/lib/THS/THS.h:4:23: fatal error: THGeneral.h: No such file or directory
compilation terminated.

Questions About Robotic Arm 3D Simulation

I have two questions about the robotic arm simulation:

  1. What is the accuracy of the model?

  2. Would it be possible to extend this model to allow for simultaneous joint movement within a single frame?

CUDA too many resources

I encountered this error:
RuntimeError: cuda runtime error (7) : too many resources requested for launch at jetson-reinforcement/build/pytorch/torch/lib/THCUNN/generic/SpatialUpSamplingBilinear.cu:63

Found a solution here: discussion and commit

I made the suggested changes to

jetson-reinforcement/build/pytorch/torch/lib/THCUNN/imcol2.h

but the error persisted. I modified the library

jetson-reinforcement/build/pytorch/torch/lib/THCUNN/SpatialUpSamplingBilinear.cu

with the suggested change from the discussion and also modified the generic

jetson-reinforcement/build/pytorch/torch/lib/THCUNN/generic/SpatialUpSamplingBilinear.cu

to limit the value of num_threads to 1024 on line 58.

Recompiled and that problem was fixed. However, now another pops up:

too many resources requested for launch at pytorch/torch/lib/THCUNN/generic/SpatialDilatedMaxPooling.cu:228

Do you have to patch all of the libraries to make it work?

I understand that this is a pytorch problem and should probably be addressed there, but the discussion is closed there, marked as resolved, the patch applied. I do need to use version 0.3.0 for other compatibility issues. I am wondering if perhaps I am doing something wrong in the build process.

Any help would be much appreciated.

Makefile:83: recipe for target 'all' failed

Bonjour, je suis TRÈS TRÈS débutant en cingulata, j'ai suivi ce tuto et la création d'une image docker avec les packages requis pour Cingulata en mode B / FV: marche bie mais à partir de création d'un conteneur à partir de l' cingulata:bfvimage avec le dossier actuel en tant que volume docker et exécutez-le sans commande: docker exécuter -it --rm -v $ ( pwd ) : / cingu cingulata: bfv j'ai ce problème:

pwd):/cingu cingulata:bfv -- Submodule ABC update -- Submodule CinguParam update BUILD_DOC OFF BUILD_ONLY_COMMON OFF USE_BFV ON USE_TFHE OFF TFHE_PATH ENABLE_UNITTEST OFF INIT_ABC_MODULE ON INIT_CINGU_PARAM_MODULE ON INIT_GOOGLETEST_MODULE OFF -- Boost version: 1.65.1 -- Found the following Boost libraries: -- program_options -- Boost version: 1.65.1 -- Found the following Boost libraries: -- program_options -- graph -- Configuring done -- Generating done -- Build files have been written to: /cingu/build_bfv [ 14%] Built target common [ 15%] Built target simple_test [ 17%] Built target test_cpp_oper [ 24%] Built target fhe_fv [ 25%] Built target decrypt [ 26%] Built target encrypt [ 27%] Built target generate_keys [ 28%] Built target pack [ 30%] Built target helper [ 34%] Built target dyn_omp [ 35%] Built target old-bfv-wiretap-gen [ 35%] Built target abc [ 35%] Built target fhe_apps [ 35%] Built target runtime [ 36%] Generating old-bfv-wiretap-opt.blif Traceback (most recent call last): File "/cingu/build_bfv/tests/../optim/abc_optimize.py", line 77, in <module> circuit = utils.readBlifFile(args.input_file) File "/cingu/build_bfv/optim/utils.py", line 32, in readBlifFile return parseBlif(lines) File "/cingu/build_bfv/optim/utils.py", line 68, in parseBlif G.nodes()[out]['gate'] = True TypeError: list indices must be integers or slices, not str tests/old_bfv/wiretap/CMakeFiles/old-bfv-wiretap.dir/build.make:64: recipe for target 'tests/old_bfv/wiretap/old-bfv-wiretap-opt.blif' failed make[2]: *** [tests/old_bfv/wiretap/old-bfv-wiretap-opt.blif] Error 1 CMakeFiles/Makefile2:3026: recipe for target 'tests/old_bfv/wiretap/CMakeFiles/old-bfv-wiretap.dir/all' failed make[1]: *** [tests/old_bfv/wiretap/CMakeFiles/old-bfv-wiretap.dir/all] Error 2 Makefile:83: recipe for target 'all' failed make: *** [all] Error 2
je précise que j'utilise ubuntu 18.04.
Je vous remercie d'avance pour vos précieuses aides.

Segmentation Fault - C++ wrapper - dqnAgent

Hi Dusty,

First of all thanks for your repositories and tutorials that are really helpful.

I am trying to build this repo on my ubuntu 16.04, Cuda 9.0, Cudnn 7, gcc 5.4...

I can run the pytorch examples successfully, but when i try to run the catch, fruit and gazebo-arm executables, in all of them I get Segmentation Fault (core dumped).

It seems to be on the following line:

// Create reinforcement learner agent in pyTorch using API
dqnAgent* agent = dqnAgent::Create(gameWidth, gameHeight, NUM_CHANNELS, NUM_ACTIONS, 
								OPTIMIZER, LEARNING_RATE, REPLAY_MEMORY, BATCH_SIZE, 
								GAMMA, EPS_START, EPS_END, EPS_DECAY, 
								USE_LSTM, LSTM_SIZE, ALLOW_RANDOM, DEBUG_DQN);

I tracked down the error until the following line (pyTensor.cpp):

t->pyTensorCPU = THPFloatTensor_New(t->cpuTensor);

I am using pytorch '0.3.0.post4'.

Any tips on what can be the reason?

Thank you very much!

Felipe.

tx2 and jetpack 3.2.1

I installed jetpack 3.2.1 on jetson tx2. Later I installed pip 10.

Finally I installed directly your code without installing ROS gazebo and gym.

$ sudo apt-get install cmake
$ git clone http://github.com/dusty-nv/jetson-reinforcement
$ cd jetson-reinforcement
$ git submodule update --init
$ mkdir build
$ cd build
$ cmake ../
$ make
After final step --make step--
I received error. what is problem

Scanning dependencies of target jetson-reinforcement
[ 40%] Building CXX object CMakeFiles/jetson-reinforcement.dir/c/dqnAgent.cpp.o
[ 42%] Building CXX object CMakeFiles/jetson-reinforcement.dir/c/rlAgent.cpp.o
In file included from /home/nvidia/jetson-reinforcement/c/rlAgent.cpp:6:0:
/home/nvidia/jetson-reinforcement/c/pyTorch.h:14:19: fatal error: TH/TH.h: No such file or directory
compilation terminated.
CMakeFiles/jetson-reinforcement.dir/build.make:93: 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

run ./gazebo-arm.sh

Hi,

Everything else is working on my Alienware laptop after install Jetpack 3.2
Other OpenAI examples work as expected, however, when running ./gazebo-arm.sh and rover:

[Err] [Node.cc:105] No namespace found
[Err] [Node.cc:105] No namespace found
[Err] [InsertModelWidget.cc:298] Missing model.config for model "/home/xxx/jetson-reinforcement/gazebo/gazebo-pkgs"
[Err] [InsertModelWidget.cc:298] Missing model.config for model "/home/xxx/jetson-reinforcement/gazebo/meshes"

Can you help?
Thanks
Tao

Loading Robotic Arm Agent

Hi Dusty ,
Thanks for incredible repository.
I have trained model for robotic arm in Gazebo simulation. When I am loading that model, I can see all
trained weights in place but new loaded model does not produce same successful runs . On some blogs I read that we need to wrap environment and then load model. Any pointers on how should I wrap Gazebo environment.

Thanks in advance.

error: unknown type name ‘ptrdiff_t’

I want to build torch on TX1, and I tried your srcipt "CMakePreBuild.sh"

But when it runs

$TORCH_PREFIX/bin/luarocks install $BUILD_ROOT/rocks/nn-scm-1.rockspec

, I receive a lot of errors of "error: unknown type name ‘ptrdiff_t’".
Do you know how to fix this?

This is the log:

cmake -E make_directory build && cd build && cmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_PREFIX_PATH="/home/ubuntu/ws/torch/torch/bin/.." -DCMAKE_INSTALL_PREFIX="/home/ubuntu/ws/torch/torch/lib/luarocks/rocks/nn/scm-1" && make

-- The C compiler identification is GNU 5.4.0
-- The CXX compiler identification is GNU 5.4.0
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found Torch7 in /home/ubuntu/ws/torch/torch
-- Try OpenMP C flag = [-fopenmp]
-- Performing Test OpenMP_FLAG_DETECTED
-- Performing Test OpenMP_FLAG_DETECTED - Success
-- Try OpenMP CXX flag = [-fopenmp]
-- Performing Test OpenMP_FLAG_DETECTED
-- Performing Test OpenMP_FLAG_DETECTED - Success
-- Found OpenMP: -fopenmp  
-- Compiling with OpenMP support
-- Configuring done
-- Generating done
-- Build files have been written to: /tmp/luarocks_nn-scm-1-9230/nn/build
Scanning dependencies of target THNN
[ 50%] Building C object lib/THNN/CMakeFiles/THNN.dir/init.c.o
/tmp/luarocks_nn-scm-1-9230/nn/lib/THNN/generic/Abs.c: In function ‘THNN_FloatAbs_updateGradInput’:
/tmp/luarocks_nn-scm-1-9230/nn/lib/THNN/init.c:18:5: error: unknown type name ‘ptrdiff_t’
     ptrdiff_t n1 = THTensor_(nElement)(I1);     \
     ^
/tmp/luarocks_nn-scm-1-9230/nn/lib/THNN/generic/Abs.c:20:3: note: in expansion of macro ‘THNN_CHECK_NELEMENT’
   THNN_CHECK_NELEMENT(input, gradOutput);
   ^
/tmp/luarocks_nn-scm-1-9230/nn/lib/THNN/init.c:19:5: error: unknown type name ‘ptrdiff_t’
     ptrdiff_t n2 = THTensor_(nElement)(I2);                                 \
     ^
/tmp/luarocks_nn-scm-1-9230/nn/lib/THNN/generic/Abs.c:20:3: note: in expansion of macro ‘THNN_CHECK_NELEMENT’
   THNN_CHECK_NELEMENT(input, gradOutput);
   ^
/tmp/luarocks_nn-scm-1-9230/nn/lib/THNN/generic/Abs.c: In function ‘THNN_DoubleAbs_updateGradInput’:
/tmp/luarocks_nn-scm-1-9230/nn/lib/THNN/init.c:18:5: error: unknown type name ‘ptrdiff_t’
     ptrdiff_t n1 = THTensor_(nElement)(I1);     \
     ^
/tmp/luarocks_nn-scm-1-9230/nn/lib/THNN/generic/Abs.c:20:3: note: in expansion of macro ‘THNN_CHECK_NELEMENT’
   THNN_CHECK_NELEMENT(input, gradOutput);
   ^
/tmp/luarocks_nn-scm-1-9230/nn/lib/THNN/init.c:19:5: error: unknown type name ‘ptrdiff_t’
     ptrdiff_t n2 = THTensor_(nElement)(I2);                                 \
     ^
/tmp/luarocks_nn-scm-1-9230/nn/lib/THNN/generic/Abs.c:20:3: note: in expansion of macro ‘THNN_CHECK_NELEMENT’
   THNN_CHECK_NELEMENT(input, gradOutput);
   ^
/tmp/luarocks_nn-scm-1-9230/nn/lib/THNN/generic/AbsCriterion.c: In function ‘THNN_FloatAbsCriterion_updateOutput’:
/tmp/luarocks_nn-scm-1-9230/nn/lib/THNN/init.c:18:5: error: unknown type name ‘ptrdiff_t’
     ptrdiff_t n1 = THTensor_(nElement)(I1);     \
     ^
/tmp/luarocks_nn-scm-1-9230/nn/lib/THNN/generic/AbsCriterion.c:13:3: note: in expansion of macro ‘THNN_CHECK_NELEMENT’
   THNN_CHECK_NELEMENT(input, target);
   ^
/tmp/luarocks_nn-scm-1-9230/nn/lib/THNN/init.c:19:5: error: unknown type name ‘ptrdiff_t’
     ptrdiff_t n2 = THTensor_(nElement)(I2);                                 \
     ^
/tmp/luarocks_nn-scm-1-9230/nn/lib/THNN/generic/AbsCriterion.c:13:3: note: in expansion of macro ‘THNN_CHECK_NELEMENT’
   THNN_CHECK_NELEMENT(input, target);
   ^
/tmp/luarocks_nn-scm-1-9230/nn/lib/THNN/generic/AbsCriterion.c: In function ‘THNN_FloatAbsCriterion_updateGradInput’:
/tmp/luarocks_nn-scm-1-9230/nn/lib/THNN/init.c:18:5: error: unknown type name ‘ptrdiff_t’
     ptrdiff_t n1 = THTensor_(nElement)(I1);     \
     ^
/tmp/luarocks_nn-scm-1-9230/nn/lib/THNN/generic/AbsCriterion.c:31:3: note: in expansion of macro ‘THNN_CHECK_NELEMENT’
   THNN_CHECK_NELEMENT(input, target);
   ^
/tmp/luarocks_nn-scm-1-9230/nn/lib/THNN/init.c:19:5: error: unknown type name ‘ptrdiff_t’
     ptrdiff_t n2 = THTensor_(nElement)(I2);                                 \
     ^
/tmp/luarocks_nn-scm-1-9230/nn/lib/THNN/generic/AbsCriterion.c:31:3: note: in expansion of macro ‘THNN_CHECK_NELEMENT’
   THNN_CHECK_NELEMENT(input, target);
   ^
/tmp/luarocks_nn-scm-1-9230/nn/lib/THNN/generic/AbsCriterion.c: In function ‘THNN_DoubleAbsCriterion_updateOutput’:
/tmp/luarocks_nn-scm-1-9230/nn/lib/THNN/init.c:18:5: error: unknown type name ‘ptrdiff_t’
     ptrdiff_t n1 = THTensor_(nElement)(I1);     \
     ^
/tmp/luarocks_nn-scm-1-9230/nn/lib/THNN/generic/AbsCriterion.c:13:3: note: in expansion of macro ‘THNN_CHECK_NELEMENT’
   THNN_CHECK_NELEMENT(input, target);
   ^
/tmp/luarocks_nn-scm-1-9230/nn/lib/THNN/init.c:19:5: error: unknown type name ‘ptrdiff_t’
     ptrdiff_t n2 = THTensor_(nElement)(I2);                                 \
     ^
/tmp/luarocks_nn-scm-1-9230/nn/lib/THNN/generic/AbsCriterion.c:13:3: note: in expansion of macro ‘THNN_CHECK_NELEMENT’
   THNN_CHECK_NELEMENT(input, target);
   ^
/tmp/luarocks_nn-scm-1-9230/nn/lib/THNN/generic/AbsCriterion.c: In function ‘THNN_DoubleAbsCriterion_updateGradInput’:
/tmp/luarocks_nn-scm-1-9230/nn/lib/THNN/init.c:18:5: error: unknown type name ‘ptrdiff_t’
     ptrdiff_t n1 = THTensor_(nElement)(I1);     \
     ^
/tmp/luarocks_nn-scm-1-9230/nn/lib/THNN/generic/AbsCriterion.c:31:3: note: in expansion of macro ‘THNN_CHECK_NELEMENT’
   THNN_CHECK_NELEMENT(input, target);
   ^
/tmp/luarocks_nn-scm-1-9230/nn/lib/THNN/init.c:19:5: error: unknown type name ‘ptrdiff_t’
     ptrdiff_t n2 = THTensor_(nElement)(I2);                                 \
     ^
/tmp/luarocks_nn-scm-1-9230/nn/lib/THNN/generic/AbsCriterion.c:31:3: note: in expansion of macro ‘THNN_CHECK_NELEMENT’
   THNN_CHECK_NELEMENT(input, target);
   ^
/tmp/luarocks_nn-scm-1-9230/nn/lib/THNN/generic/BCECriterion.c: In function ‘THNN_FloatBCECriterion_updateOutput’:
/tmp/luarocks_nn-scm-1-9230/nn/lib/THNN/init.c:18:5: error: unknown type name ‘ptrdiff_t’
     ptrdiff_t n1 = THTensor_(nElement)(I1);     \
     ^
/tmp/luarocks_nn-scm-1-9230/nn/lib/THNN/generic/BCECriterion.c:11:3: note: in expansion of macro ‘THNN_CHECK_NELEMENT’
   THNN_CHECK_NELEMENT(input, target);
   ^
/tmp/luarocks_nn-scm-1-9230/nn/lib/THNN/init.c:19:5: error: unknown type name ‘ptrdiff_t’
     ptrdiff_t n2 = THTensor_(nElement)(I2);                                 \
     ^
/tmp/luarocks_nn-scm-1-9230/nn/lib/THNN/generic/BCECriterion.c:11:3: note: in expansion of macro ‘THNN_CHECK_NELEMENT’
   THNN_CHECK_NELEMENT(input, target);
   ^
/tmp/luarocks_nn-scm-1-9230/nn/lib/THNN/init.c:18:5: error: unknown type name ‘ptrdiff_t’
     ptrdiff_t n1 = THTensor_(nElement)(I1);     \
     ^
/tmp/luarocks_nn-scm-1-9230/nn/lib/THNN/generic/BCECriterion.c:12:3: note: in expansion of macro ‘THNN_CHECK_NELEMENT’
   THNN_CHECK_NELEMENT(input, weights);
   ^
/tmp/luarocks_nn-scm-1-9230/nn/lib/THNN/init.c:19:5: error: unknown type name ‘ptrdiff_t’
     ptrdiff_t n2 = THTensor_(nElement)(I2);                                 \
     ^
/tmp/luarocks_nn-scm-1-9230/nn/lib/THNN/generic/BCECriterion.c:12:3: note: in expansion of macro ‘THNN_CHECK_NELEMENT’
   THNN_CHECK_NELEMENT(input, weights);
   ^
/tmp/luarocks_nn-scm-1-9230/nn/lib/THNN/generic/BCECriterion.c: In function ‘THNN_FloatBCECriterion_updateGradInput’:
/tmp/luarocks_nn-scm-1-9230/nn/lib/THNN/init.c:18:5: error: unknown type name ‘ptrdiff_t’
     ptrdiff_t n1 = THTensor_(nElement)(I1);     \
     ^
/tmp/luarocks_nn-scm-1-9230/nn/lib/THNN/generic/BCECriterion.c:41:3: note: in expansion of macro ‘THNN_CHECK_NELEMENT’
   THNN_CHECK_NELEMENT(input, target);
   ^
/tmp/luarocks_nn-scm-1-9230/nn/lib/THNN/init.c:19:5: error: unknown type name ‘ptrdiff_t’
     ptrdiff_t n2 = THTensor_(nElement)(I2);                                 \
     ^
/tmp/luarocks_nn-scm-1-9230/nn/lib/THNN/generic/BCECriterion.c:41:3: note: in expansion of macro ‘THNN_CHECK_NELEMENT’
   THNN_CHECK_NELEMENT(input, target);
   ^
/tmp/luarocks_nn-scm-1-9230/nn/lib/THNN/init.c:18:5: error: unknown type name ‘ptrdiff_t’
     ptrdiff_t n1 = THTensor_(nElement)(I1);     \
     ^
/tmp/luarocks_nn-scm-1-9230/nn/lib/THNN/generic/BCECriterion.c:42:3: note: in expansion of macro ‘THNN_CHECK_NELEMENT’
   THNN_CHECK_NELEMENT(input, weights);
   ^
/tmp/luarocks_nn-scm-1-9230/nn/lib/THNN/init.c:19:5: error: unknown type name ‘ptrdiff_t’
     ptrdiff_t n2 = THTensor_(nElement)(I2);                                 \
     ^
/tmp/luarocks_nn-scm-1-9230/nn/lib/THNN/generic/BCECriterion.c:42:3: note: in expansion of macro ‘THNN_CHECK_NELEMENT’
   THNN_CHECK_NELEMENT(input, weights);
   ^
/tmp/luarocks_nn-scm-1-9230/nn/lib/THNN/generic/BCECriterion.c: In function ‘THNN_DoubleBCECriterion_updateOutput’:
/tmp/luarocks_nn-scm-1-9230/nn/lib/THNN/init.c:18:5: error: unknown type name ‘ptrdiff_t’
     ptrdiff_t n1 = THTensor_(nElement)(I1);     \
     ^
/tmp/luarocks_nn-scm-1-9230/nn/lib/THNN/generic/BCECriterion.c:11:3: note: in expansion of macro ‘THNN_CHECK_NELEMENT’
   THNN_CHECK_NELEMENT(input, target);
   ^
/tmp/luarocks_nn-scm-1-9230/nn/lib/THNN/init.c:19:5: error: unknown type name ‘ptrdiff_t’
     ptrdiff_t n2 = THTensor_(nElement)(I2);                                 \
     ^
/tmp/luarocks_nn-scm-1-9230/nn/lib/THNN/generic/BCECriterion.c:11:3: note: in expansion of macro ‘THNN_CHECK_NELEMENT’
   THNN_CHECK_NELEMENT(input, target);
   ^
/tmp/luarocks_nn-scm-1-9230/nn/lib/THNN/init.c:18:5: error: unknown type name ‘ptrdiff_t’
     ptrdiff_t n1 = THTensor_(nElement)(I1);     \
     ^
/tmp/luarocks_nn-scm-1-9230/nn/lib/THNN/generic/BCECriterion.c:12:3: note: in expansion of macro ‘THNN_CHECK_NELEMENT’
   THNN_CHECK_NELEMENT(input, weights);
   ^
/tmp/luarocks_nn-scm-1-9230/nn/lib/THNN/init.c:19:5: error: unknown type name ‘ptrdiff_t’
     ptrdiff_t n2 = THTensor_(nElement)(I2);                                 \
     ^
/tmp/luarocks_nn-scm-1-9230/nn/lib/THNN/generic/BCECriterion.c:12:3: note: in expansion of macro ‘THNN_CHECK_NELEMENT’
   THNN_CHECK_NELEMENT(input, weights);
   ^
/tmp/luarocks_nn-scm-1-9230/nn/lib/THNN/generic/BCECriterion.c: In function ‘THNN_DoubleBCECriterion_updateGradInput’:
/tmp/luarocks_nn-scm-1-9230/nn/lib/THNN/init.c:18:5: error: unknown type name ‘ptrdiff_t’
     ptrdiff_t n1 = THTensor_(nElement)(I1);     \
     ^
/tmp/luarocks_nn-scm-1-9230/nn/lib/THNN/generic/BCECriterion.c:41:3: note: in expansion of macro ‘THNN_CHECK_NELEMENT’
   THNN_CHECK_NELEMENT(input, target);
   ^
/tmp/luarocks_nn-scm-1-9230/nn/lib/THNN/init.c:19:5: error: unknown type name ‘ptrdiff_t’
     ptrdiff_t n2 = THTensor_(nElement)(I2);                                 \
     ^
/tmp/luarocks_nn-scm-1-9230/nn/lib/THNN/generic/BCECriterion.c:41:3: note: in expansion of macro ‘THNN_CHECK_NELEMENT’
   THNN_CHECK_NELEMENT(input, target);
   ^
/tmp/luarocks_nn-scm-1-9230/nn/lib/THNN/init.c:18:5: error: unknown type name ‘ptrdiff_t’
     ptrdiff_t n1 = THTensor_(nElement)(I1);     \
     ^
/tmp/luarocks_nn-scm-1-9230/nn/lib/THNN/generic/BCECriterion.c:42:3: note: in expansion of macro ‘THNN_CHECK_NELEMENT’
   THNN_CHECK_NELEMENT(input, weights);
   ^
/tmp/luarocks_nn-scm-1-9230/nn/lib/THNN/init.c:19:5: error: unknown type name ‘ptrdiff_t’
     ptrdiff_t n2 = THTensor_(nElement)(I2);                                 \
     ^
/tmp/luarocks_nn-scm-1-9230/nn/lib/THNN/generic/BCECriterion.c:42:3: note: in expansion of macro ‘THNN_CHECK_NELEMENT’
   THNN_CHECK_NELEMENT(input, weights);
   ^
/tmp/luarocks_nn-scm-1-9230/nn/lib/THNN/generic/DistKLDivCriterion.c: In function ‘THNN_FloatDistKLDivCriterion_updateOutput’:
/tmp/luarocks_nn-scm-1-9230/nn/lib/THNN/init.c:18:5: error: unknown type name ‘ptrdiff_t’
     ptrdiff_t n1 = THTensor_(nElement)(I1);     \
     ^
/tmp/luarocks_nn-scm-1-9230/nn/lib/THNN/generic/DistKLDivCriterion.c:12:3: note: in expansion of macro ‘THNN_CHECK_NELEMENT’
   THNN_CHECK_NELEMENT(input, target);
   ^
/tmp/luarocks_nn-scm-1-9230/nn/lib/THNN/init.c:19:5: error: unknown type name ‘ptrdiff_t’
     ptrdiff_t n2 = THTensor_(nElement)(I2);                                 \
     ^
/tmp/luarocks_nn-scm-1-9230/nn/lib/THNN/generic/DistKLDivCriterion.c:12:3: note: in expansion of macro ‘THNN_CHECK_NELEMENT’
   THNN_CHECK_NELEMENT(input, target);
   ^
/tmp/luarocks_nn-scm-1-9230/nn/lib/THNN/generic/DistKLDivCriterion.c: In function ‘THNN_FloatDistKLDivCriterion_updateGradInput’:
/tmp/luarocks_nn-scm-1-9230/nn/lib/THNN/init.c:18:5: error: unknown type name ‘ptrdiff_t’
     ptrdiff_t n1 = THTensor_(nElement)(I1);     \
     ^
/tmp/luarocks_nn-scm-1-9230/nn/lib/THNN/generic/DistKLDivCriterion.c:34:3: note: in expansion of macro ‘THNN_CHECK_NELEMENT’
   THNN_CHECK_NELEMENT(input, target);
   ^
/tmp/luarocks_nn-scm-1-9230/nn/lib/THNN/init.c:19:5: error: unknown type name ‘ptrdiff_t’
     ptrdiff_t n2 = THTensor_(nElement)(I2);                                 \
     ^
/tmp/luarocks_nn-scm-1-9230/nn/lib/THNN/generic/DistKLDivCriterion.c:34:3: note: in expansion of macro ‘THNN_CHECK_NELEMENT’
   THNN_CHECK_NELEMENT(input, target);
   ^
/tmp/luarocks_nn-scm-1-9230/nn/lib/THNN/generic/DistKLDivCriterion.c: In function ‘THNN_DoubleDistKLDivCriterion_updateOutput’:
/tmp/luarocks_nn-scm-1-9230/nn/lib/THNN/init.c:18:5: error: unknown type name ‘ptrdiff_t’
     ptrdiff_t n1 = THTensor_(nElement)(I1);     \
     ^
/tmp/luarocks_nn-scm-1-9230/nn/lib/THNN/generic/DistKLDivCriterion.c:12:3: note: in expansion of macro ‘THNN_CHECK_NELEMENT’
   THNN_CHECK_NELEMENT(input, target);
   ^
/tmp/luarocks_nn-scm-1-9230/nn/lib/THNN/init.c:19:5: error: unknown type name ‘ptrdiff_t’
     ptrdiff_t n2 = THTensor_(nElement)(I2);                                 \
     ^
/tmp/luarocks_nn-scm-1-9230/nn/lib/THNN/generic/DistKLDivCriterion.c:12:3: note: in expansion of macro ‘THNN_CHECK_NELEMENT’
   THNN_CHECK_NELEMENT(input, target);
   ^
/tmp/luarocks_nn-scm-1-9230/nn/lib/THNN/generic/DistKLDivCriterion.c: In function ‘THNN_DoubleDistKLDivCriterion_updateGradInput’:
/tmp/luarocks_nn-scm-1-9230/nn/lib/THNN/init.c:18:5: error: unknown type name ‘ptrdiff_t’
     ptrdiff_t n1 = THTensor_(nElement)(I1);     \
     ^
/tmp/luarocks_nn-scm-1-9230/nn/lib/THNN/generic/DistKLDivCriterion.c:34:3: note: in expansion of macro ‘THNN_CHECK_NELEMENT’
   THNN_CHECK_NELEMENT(input, target);
   ^
/tmp/luarocks_nn-scm-1-9230/nn/lib/THNN/init.c:19:5: error: unknown type name ‘ptrdiff_t’
     ptrdiff_t n2 = THTensor_(nElement)(I2);                                 \
     ^
/tmp/luarocks_nn-scm-1-9230/nn/lib/THNN/generic/DistKLDivCriterion.c:34:3: note: in expansion of macro ‘THNN_CHECK_NELEMENT’
   THNN_CHECK_NELEMENT(input, target);
   ^
/tmp/luarocks_nn-scm-1-9230/nn/lib/THNN/generic/ELU.c: In function ‘THNN_FloatELU_updateGradInput’:
/tmp/luarocks_nn-scm-1-9230/nn/lib/THNN/init.c:18:5: error: unknown type name ‘ptrdiff_t’
     ptrdiff_t n1 = THTensor_(nElement)(I1);     \
     ^
/tmp/luarocks_nn-scm-1-9230/nn/lib/THNN/generic/ELU.c:36:3: note: in expansion of macro ‘THNN_CHECK_NELEMENT’
   THNN_CHECK_NELEMENT(input, gradOutput);
   ^
/tmp/luarocks_nn-scm-1-9230/nn/lib/THNN/init.c:19:5: error: unknown type name ‘ptrdiff_t’
     ptrdiff_t n2 = THTensor_(nElement)(I2);                                 \
     ^
/tmp/luarocks_nn-scm-1-9230/nn/lib/THNN/generic/ELU.c:36:3: note: in expansion of macro ‘THNN_CHECK_NELEMENT’
   THNN_CHECK_NELEMENT(input, gradOutput);
   ^
/tmp/luarocks_nn-scm-1-9230/nn/lib/THNN/generic/ELU.c: In function ‘THNN_DoubleELU_updateGradInput’:
/tmp/luarocks_nn-scm-1-9230/nn/lib/THNN/init.c:18:5: error: unknown type name ‘ptrdiff_t’
     ptrdiff_t n1 = THTensor_(nElement)(I1);     \
     ^
/tmp/luarocks_nn-scm-1-9230/nn/lib/THNN/generic/ELU.c:36:3: note: in expansion of macro ‘THNN_CHECK_NELEMENT’
   THNN_CHECK_NELEMENT(input, gradOutput);
   ^
/tmp/luarocks_nn-scm-1-9230/nn/lib/THNN/init.c:19:5: error: unknown type name ‘ptrdiff_t’
     ptrdiff_t n2 = THTensor_(nElement)(I2);                                 \
     ^
/tmp/luarocks_nn-scm-1-9230/nn/lib/THNN/generic/ELU.c:36:3: note: in expansion of macro ‘THNN_CHECK_NELEMENT’
   THNN_CHECK_NELEMENT(input, gradOutput);
   ^
/tmp/luarocks_nn-scm-1-9230/nn/lib/THNN/generic/HardShrink.c: In function ‘THNN_FloatHardShrink_updateGradInput’:
/tmp/luarocks_nn-scm-1-9230/nn/lib/THNN/init.c:18:5: error: unknown type name ‘ptrdiff_t’
     ptrdiff_t n1 = THTensor_(nElement)(I1);     \
     ^
/tmp/luarocks_nn-scm-1-9230/nn/lib/THNN/generic/HardShrink.c:30:3: note: in expansion of macro ‘THNN_CHECK_NELEMENT’
   THNN_CHECK_NELEMENT(input, gradOutput);
   ^
/tmp/luarocks_nn-scm-1-9230/nn/lib/THNN/init.c:19:5: error: unknown type name ‘ptrdiff_t’
     ptrdiff_t n2 = THTensor_(nElement)(I2);                                 \
     ^
/tmp/luarocks_nn-scm-1-9230/nn/lib/THNN/generic/HardShrink.c:30:3: note: in expansion of macro ‘THNN_CHECK_NELEMENT’
   THNN_CHECK_NELEMENT(input, gradOutput);
   ^
/tmp/luarocks_nn-scm-1-9230/nn/lib/THNN/generic/HardShrink.c: In function ‘THNN_DoubleHardShrink_updateGradInput’:
/tmp/luarocks_nn-scm-1-9230/nn/lib/THNN/init.c:18:5: error: unknown type name ‘ptrdiff_t’
     ptrdiff_t n1 = THTensor_(nElement)(I1);     \
     ^
/tmp/luarocks_nn-scm-1-9230/nn/lib/THNN/generic/HardShrink.c:30:3: note: in expansion of macro ‘THNN_CHECK_NELEMENT’
   THNN_CHECK_NELEMENT(input, gradOutput);
   ^
/tmp/luarocks_nn-scm-1-9230/nn/lib/THNN/init.c:19:5: error: unknown type name ‘ptrdiff_t’
     ptrdiff_t n2 = THTensor_(nElement)(I2);                                 \
     ^
/tmp/luarocks_nn-scm-1-9230/nn/lib/THNN/generic/HardShrink.c:30:3: note: in expansion of macro ‘THNN_CHECK_NELEMENT’
   THNN_CHECK_NELEMENT(input, gradOutput);
   ^
In file included from generic/HardTanh.c:1:0,
                 from /tmp/luarocks_nn-scm-1-9230/nn/lib/THNN/init.c:69:
/tmp/luarocks_nn-scm-1-9230/nn/lib/THNN/generic/HardTanh.c: In function ‘THNN_FloatHardTanh_updateOutput’:
/tmp/luarocks_nn-scm-1-9230/nn/lib/THNN/generic/HardTanh.c:40:5: error: unknown type name ‘ptrdiff_t’
     ptrdiff_t i;
     ^
/tmp/luarocks_nn-scm-1-9230/nn/lib/THNN/generic/HardTanh.c:41:5: error: unknown type name ‘ptrdiff_t’
     ptrdiff_t n = THTensor_(nElement)(input);
     ^
/tmp/luarocks_nn-scm-1-9230/nn/lib/THNN/generic/HardTanh.c: In function ‘THNN_FloatHardTanh_updateGradInput’:
/tmp/luarocks_nn-scm-1-9230/nn/lib/THNN/init.c:18:5: error: unknown type name ‘ptrdiff_t’
     ptrdiff_t n1 = THTensor_(nElement)(I1);     \
     ^
/tmp/luarocks_nn-scm-1-9230/nn/lib/THNN/generic/HardTanh.c:75:3: note: in expansion of macro ‘THNN_CHECK_NELEMENT’
   THNN_CHECK_NELEMENT(input, gradOutput);
   ^
/tmp/luarocks_nn-scm-1-9230/nn/lib/THNN/init.c:19:5: error: unknown type name ‘ptrdiff_t’
     ptrdiff_t n2 = THTensor_(nElement)(I2);                                 \
     ^
/tmp/luarocks_nn-scm-1-9230/nn/lib/THNN/generic/HardTanh.c:75:3: note: in expansion of macro ‘THNN_CHECK_NELEMENT’
   THNN_CHECK_NELEMENT(input, gradOutput);
   ^
In file included from generic/HardTanh.c:1:0,
                 from /tmp/luarocks_nn-scm-1-9230/nn/lib/THNN/init.c:69:
/tmp/luarocks_nn-scm-1-9230/nn/lib/THNN/generic/HardTanh.c:106:5: error: unknown type name ‘ptrdiff_t’
     ptrdiff_t i;
     ^
/tmp/luarocks_nn-scm-1-9230/nn/lib/THNN/generic/HardTanh.c:107:5: error: unknown type name ‘ptrdiff_t’
     ptrdiff_t n = THTensor_(nElement)(input);
     ^
In file included from generic/HardTanh.c:1:0,
                 from /tmp/luarocks_nn-scm-1-9230/nn/lib/THNN/init.c:69:
/tmp/luarocks_nn-scm-1-9230/nn/lib/THNN/generic/HardTanh.c: In function ‘THNN_DoubleHardTanh_updateOutput’:
/tmp/luarocks_nn-scm-1-9230/nn/lib/THNN/generic/HardTanh.c:40:5: error: unknown type name ‘ptrdiff_t’
     ptrdiff_t i;
     ^
/tmp/luarocks_nn-scm-1-9230/nn/lib/THNN/generic/HardTanh.c:41:5: error: unknown type name ‘ptrdiff_t’
     ptrdiff_t n = THTensor_(nElement)(input);
     ^
/tmp/luarocks_nn-scm-1-9230/nn/lib/THNN/generic/HardTanh.c: In function ‘THNN_DoubleHardTanh_updateGradInput’:
/tmp/luarocks_nn-scm-1-9230/nn/lib/THNN/init.c:18:5: error: unknown type name ‘ptrdiff_t’
     ptrdiff_t n1 = THTensor_(nElement)(I1);     \
     ^
/tmp/luarocks_nn-scm-1-9230/nn/lib/THNN/generic/HardTanh.c:75:3: note: in expansion of macro ‘THNN_CHECK_NELEMENT’
   THNN_CHECK_NELEMENT(input, gradOutput);
   ^
/tmp/luarocks_nn-scm-1-9230/nn/lib/THNN/init.c:19:5: error: unknown type name ‘ptrdiff_t’
     ptrdiff_t n2 = THTensor_(nElement)(I2);                                 \
     ^
/tmp/luarocks_nn-scm-1-9230/nn/lib/THNN/generic/HardTanh.c:75:3: note: in expansion of macro ‘THNN_CHECK_NELEMENT’
   THNN_CHECK_NELEMENT(input, gradOutput);
   ^
In file included from generic/HardTanh.c:1:0,
                 from /tmp/luarocks_nn-scm-1-9230/nn/lib/THNN/init.c:69:
/tmp/luarocks_nn-scm-1-9230/nn/lib/THNN/generic/HardTanh.c:106:5: error: unknown type name ‘ptrdiff_t’
     ptrdiff_t i;
     ^
/tmp/luarocks_nn-scm-1-9230/nn/lib/THNN/generic/HardTanh.c:107:5: error: unknown type name ‘ptrdiff_t’
     ptrdiff_t n = THTensor_(nElement)(input);
     ^
/tmp/luarocks_nn-scm-1-9230/nn/lib/THNN/generic/L1Cost.c: In function ‘THNN_FloatL1Cost_updateGradInput’:
/tmp/luarocks_nn-scm-1-9230/nn/lib/THNN/init.c:18:5: error: unknown type name ‘ptrdiff_t’
     ptrdiff_t n1 = THTensor_(nElement)(I1);     \
     ^
/tmp/luarocks_nn-scm-1-9230/nn/lib/THNN/generic/L1Cost.c:26:3: note: in expansion of macro ‘THNN_CHECK_NELEMENT’
   THNN_CHECK_NELEMENT(input, gradOutput);
   ^
/tmp/luarocks_nn-scm-1-9230/nn/lib/THNN/init.c:19:5: error: unknown type name ‘ptrdiff_t’
     ptrdiff_t n2 = THTensor_(nElement)(I2);                                 \
     ^
/tmp/luarocks_nn-scm-1-9230/nn/lib/THNN/generic/L1Cost.c:26:3: note: in expansion of macro ‘THNN_CHECK_NELEMENT’
   THNN_CHECK_NELEMENT(input, gradOutput);
   ^
/tmp/luarocks_nn-scm-1-9230/nn/lib/THNN/generic/L1Cost.c: In function ‘THNN_DoubleL1Cost_updateGradInput’:
/tmp/luarocks_nn-scm-1-9230/nn/lib/THNN/init.c:18:5: error: unknown type name ‘ptrdiff_t’
     ptrdiff_t n1 = THTensor_(nElement)(I1);     \
     ^
/tmp/luarocks_nn-scm-1-9230/nn/lib/THNN/generic/L1Cost.c:26:3: note: in expansion of macro ‘THNN_CHECK_NELEMENT’
   THNN_CHECK_NELEMENT(input, gradOutput);
   ^
/tmp/luarocks_nn-scm-1-9230/nn/lib/THNN/init.c:19:5: error: unknown type name ‘ptrdiff_t’
     ptrdiff_t n2 = THTensor_(nElement)(I2);                                 \
     ^
/tmp/luarocks_nn-scm-1-9230/nn/lib/THNN/generic/L1Cost.c:26:3: note: in expansion of macro ‘THNN_CHECK_NELEMENT’
   THNN_CHECK_NELEMENT(input, gradOutput);
   ^
/tmp/luarocks_nn-scm-1-9230/nn/lib/THNN/generic/LeakyReLU.c: In function ‘THNN_FloatLeakyReLU_updateGradInput’:
/tmp/luarocks_nn-scm-1-9230/nn/lib/THNN/init.c:18:5: error: unknown type name ‘ptrdiff_t’
     ptrdiff_t n1 = THTensor_(nElement)(I1);     \
     ^
/tmp/luarocks_nn-scm-1-9230/nn/lib/THNN/generic/LeakyReLU.c:37:3: note: in expansion of macro ‘THNN_CHECK_NELEMENT’
   THNN_CHECK_NELEMENT(input, gradOutput);
   ^
/tmp/luarocks_nn-scm-1-9230/nn/lib/THNN/init.c:19:5: error: unknown type name ‘ptrdiff_t’
     ptrdiff_t n2 = THTensor_(nElement)(I2);                                 \
     ^
/tmp/luarocks_nn-scm-1-9230/nn/lib/THNN/generic/LeakyReLU.c:37:3: note: in expansion of macro ‘THNN_CHECK_NELEMENT’
   THNN_CHECK_NELEMENT(input, gradOutput);
   ^
/tmp/luarocks_nn-scm-1-9230/nn/lib/THNN/generic/LeakyReLU.c: In function ‘THNN_DoubleLeakyReLU_updateGradInput’:
/tmp/luarocks_nn-scm-1-9230/nn/lib/THNN/init.c:18:5: error: unknown type name ‘ptrdiff_t’
     ptrdiff_t n1 = THTensor_(nElement)(I1);     \
     ^
/tmp/luarocks_nn-scm-1-9230/nn/lib/THNN/generic/LeakyReLU.c:37:3: note: in expansion of macro ‘THNN_CHECK_NELEMENT’
   THNN_CHECK_NELEMENT(input, gradOutput);
   ^
/tmp/luarocks_nn-scm-1-9230/nn/lib/THNN/init.c:19:5: error: unknown type name ‘ptrdiff_t’
     ptrdiff_t n2 = THTensor_(nElement)(I2);                                 \
     ^
/tmp/luarocks_nn-scm-1-9230/nn/lib/THNN/generic/LeakyReLU.c:37:3: note: in expansion of macro ‘THNN_CHECK_NELEMENT’
   THNN_CHECK_NELEMENT(input, gradOutput);
   ^
/tmp/luarocks_nn-scm-1-9230/nn/lib/THNN/generic/LogSigmoid.c: In function ‘THNN_FloatLogSigmoid_updateGradInput’:
/tmp/luarocks_nn-scm-1-9230/nn/lib/THNN/init.c:18:5: error: unknown type name ‘ptrdiff_t’
     ptrdiff_t n1 = THTensor_(nElement)(I1);     \
     ^
/tmp/luarocks_nn-scm-1-9230/nn/lib/THNN/generic/LogSigmoid.c:28:3: note: in expansion of macro ‘THNN_CHECK_NELEMENT’
   THNN_CHECK_NELEMENT(input, gradOutput);
   ^
/tmp/luarocks_nn-scm-1-9230/nn/lib/THNN/init.c:19:5: error: unknown type name ‘ptrdiff_t’
     ptrdiff_t n2 = THTensor_(nElement)(I2);                                 \
     ^
/tmp/luarocks_nn-scm-1-9230/nn/lib/THNN/generic/LogSigmoid.c:28:3: note: in expansion of macro ‘THNN_CHECK_NELEMENT’
   THNN_CHECK_NELEMENT(input, gradOutput);
   ^
/tmp/luarocks_nn-scm-1-9230/nn/lib/THNN/generic/LogSigmoid.c: In function ‘THNN_DoubleLogSigmoid_updateGradInput’:
/tmp/luarocks_nn-scm-1-9230/nn/lib/THNN/init.c:18:5: error: unknown type name ‘ptrdiff_t’
     ptrdiff_t n1 = THTensor_(nElement)(I1);     \
     ^
/tmp/luarocks_nn-scm-1-9230/nn/lib/THNN/generic/LogSigmoid.c:28:3: note: in expansion of macro ‘THNN_CHECK_NELEMENT’
   THNN_CHECK_NELEMENT(input, gradOutput);
   ^
/tmp/luarocks_nn-scm-1-9230/nn/lib/THNN/init.c:19:5: error: unknown type name ‘ptrdiff_t’
     ptrdiff_t n2 = THTensor_(nElement)(I2);                                 \
     ^
/tmp/luarocks_nn-scm-1-9230/nn/lib/THNN/generic/LogSigmoid.c:28:3: note: in expansion of macro ‘THNN_CHECK_NELEMENT’
   THNN_CHECK_NELEMENT(input, gradOutput);
   ^
In file included from generic/LogSoftMax.c:1:0,
                 from /tmp/luarocks_nn-scm-1-9230/nn/lib/THNN/init.c:81:
/tmp/luarocks_nn-scm-1-9230/nn/lib/THNN/generic/LogSoftMax.c: In function ‘THNN_FloatLogSoftMax_updateOutput’:
/tmp/luarocks_nn-scm-1-9230/nn/lib/THNN/generic/LogSoftMax.c:11:3: error: unknown type name ‘ptrdiff_t’
   ptrdiff_t nframe = 0, dim = 0, stride = 0;
   ^
/tmp/luarocks_nn-scm-1-9230/nn/lib/THNN/generic/LogSoftMax.c:12:3: error: unknown type name ‘ptrdiff_t’
   ptrdiff_t t, d;
   ^
/tmp/luarocks_nn-scm-1-9230/nn/lib/THNN/generic/LogSoftMax.c: In function ‘THNN_FloatLogSoftMax_updateGradInput’:
/tmp/luarocks_nn-scm-1-9230/nn/lib/THNN/generic/LogSoftMax.c:81:3: error: unknown type name ‘ptrdiff_t’
   ptrdiff_t nframe = 0, dim = 0, stride = 0;
   ^
/tmp/luarocks_nn-scm-1-9230/nn/lib/THNN/generic/LogSoftMax.c:82:3: error: unknown type name ‘ptrdiff_t’
   ptrdiff_t t, d;
   ^
In file included from generic/LogSoftMax.c:1:0,
                 from /tmp/luarocks_nn-scm-1-9230/nn/lib/THNN/init.c:81:
/tmp/luarocks_nn-scm-1-9230/nn/lib/THNN/generic/LogSoftMax.c: In function ‘THNN_DoubleLogSoftMax_updateOutput’:
/tmp/luarocks_nn-scm-1-9230/nn/lib/THNN/generic/LogSoftMax.c:11:3: error: unknown type name ‘ptrdiff_t’
   ptrdiff_t nframe = 0, dim = 0, stride = 0;
   ^
/tmp/luarocks_nn-scm-1-9230/nn/lib/THNN/generic/LogSoftMax.c:12:3: error: unknown type name ‘ptrdiff_t’
   ptrdiff_t t, d;
   ^
/tmp/luarocks_nn-scm-1-9230/nn/lib/THNN/generic/LogSoftMax.c: In function ‘THNN_DoubleLogSoftMax_updateGradInput’:
/tmp/luarocks_nn-scm-1-9230/nn/lib/THNN/generic/LogSoftMax.c:81:3: error: unknown type name ‘ptrdiff_t’
   ptrdiff_t nframe = 0, dim = 0, stride = 0;
   ^
/tmp/luarocks_nn-scm-1-9230/nn/lib/THNN/generic/LogSoftMax.c:82:3: error: unknown type name ‘ptrdiff_t’
   ptrdiff_t t, d;
   ^
In file included from generic/LookupTable.c:1:0,
                 from /tmp/luarocks_nn-scm-1-9230/nn/lib/THNN/init.c:84:
/tmp/luarocks_nn-scm-1-9230/nn/lib/THNN/generic/LookupTable.c: In function ‘THNN_FloatLookupTable_resetCount’:
/tmp/luarocks_nn-scm-1-9230/nn/lib/THNN/generic/LookupTable.c:9:3: error: unknown type name ‘ptrdiff_t’
   ptrdiff_t i;
   ^
/tmp/luarocks_nn-scm-1-9230/nn/lib/THNN/generic/LookupTable.c:11:3: error: unknown type name ‘ptrdiff_t’
   ptrdiff_t numel = THIndexTensor_(nElement)(input);
   ^
/tmp/luarocks_nn-scm-1-9230/nn/lib/THNN/generic/LookupTable.c: In function ‘THNN_FloatLookupTable_accGradParameters’:
/tmp/luarocks_nn-scm-1-9230/nn/lib/THNN/generic/LookupTable.c:37:3: error: unknown type name ‘ptrdiff_t’
   ptrdiff_t i;
   ^
/tmp/luarocks_nn-scm-1-9230/nn/lib/THNN/generic/LookupTable.c:56:3: error: unknown type name ‘ptrdiff_t’
   ptrdiff_t numel = THIndexTensor_(nElement)(input);
   ^
/tmp/luarocks_nn-scm-1-9230/nn/lib/THNN/generic/LookupTable.c: In function ‘THNN_FloatLookupTable_renorm’:
/tmp/luarocks_nn-scm-1-9230/nn/lib/THNN/generic/LookupTable.c:178:3: error: unknown type name ‘ptrdiff_t’
   ptrdiff_t i;
   ^
/tmp/luarocks_nn-scm-1-9230/nn/lib/THNN/generic/LookupTable.c:180:3: error: unknown type name ‘ptrdiff_t’
   ptrdiff_t numel = THIndexTensor_(nElement)(idx);
   ^
/tmp/luarocks_nn-scm-1-9230/nn/lib/THNN/generic/LookupTable.c:194:3: error: unknown type name ‘ptrdiff_t’
   ptrdiff_t ptr = 0;
   ^
In file included from generic/LookupTable.c:1:0,
                 from /tmp/luarocks_nn-scm-1-9230/nn/lib/THNN/init.c:84:
/tmp/luarocks_nn-scm-1-9230/nn/lib/THNN/generic/LookupTable.c: In function ‘THNN_DoubleLookupTable_resetCount’:
/tmp/luarocks_nn-scm-1-9230/nn/lib/THNN/generic/LookupTable.c:9:3: error: unknown type name ‘ptrdiff_t’
   ptrdiff_t i;
   ^
/tmp/luarocks_nn-scm-1-9230/nn/lib/THNN/generic/LookupTable.c:11:3: error: unknown type name ‘ptrdiff_t’
   ptrdiff_t numel = THIndexTensor_(nElement)(input);
   ^
/tmp/luarocks_nn-scm-1-9230/nn/lib/THNN/generic/LookupTable.c: In function ‘THNN_DoubleLookupTable_accGradParameters’:
/tmp/luarocks_nn-scm-1-9230/nn/lib/THNN/generic/LookupTable.c:37:3: error: unknown type name ‘ptrdiff_t’
   ptrdiff_t i;
   ^
/tmp/luarocks_nn-scm-1-9230/nn/lib/THNN/generic/LookupTable.c:56:3: error: unknown type name ‘ptrdiff_t’
   ptrdiff_t numel = THIndexTensor_(nElement)(input);
   ^
/tmp/luarocks_nn-scm-1-9230/nn/lib/THNN/generic/LookupTable.c: In function ‘THNN_DoubleLookupTable_renorm’:
/tmp/luarocks_nn-scm-1-9230/nn/lib/THNN/generic/LookupTable.c:178:3: error: unknown type name ‘ptrdiff_t’
   ptrdiff_t i;
   ^
/tmp/luarocks_nn-scm-1-9230/nn/lib/THNN/generic/LookupTable.c:180:3: error: unknown type name ‘ptrdiff_t’
   ptrdiff_t numel = THIndexTensor_(nElement)(idx);
   ^
/tmp/luarocks_nn-scm-1-9230/nn/lib/THNN/generic/LookupTable.c:194:3: error: unknown type name ‘ptrdiff_t’
   ptrdiff_t ptr = 0;
   ^
/tmp/luarocks_nn-scm-1-9230/nn/lib/THNN/generic/MSECriterion.c: In function ‘THNN_FloatMSECriterion_updateOutput’:
/tmp/luarocks_nn-scm-1-9230/nn/lib/THNN/init.c:18:5: error: unknown type name ‘ptrdiff_t’
     ptrdiff_t n1 = THTensor_(nElement)(I1);     \
     ^
/tmp/luarocks_nn-scm-1-9230/nn/lib/THNN/generic/MSECriterion.c:12:3: note: in expansion of macro ‘THNN_CHECK_NELEMENT’
   THNN_CHECK_NELEMENT(input, target);
   ^
/tmp/luarocks_nn-scm-1-9230/nn/lib/THNN/init.c:19:5: error: unknown type name ‘ptrdiff_t’
     ptrdiff_t n2 = THTensor_(nElement)(I2);                                 \
     ^
/tmp/luarocks_nn-scm-1-9230/nn/lib/THNN/generic/MSECriterion.c:12:3: note: in expansion of macro ‘THNN_CHECK_NELEMENT’
   THNN_CHECK_NELEMENT(input, target);
   ^
/tmp/luarocks_nn-scm-1-9230/nn/lib/THNN/generic/MSECriterion.c: In function ‘THNN_FloatMSECriterion_updateGradInput’:
/tmp/luarocks_nn-scm-1-9230/nn/lib/THNN/init.c:18:5: error: unknown type name ‘ptrdiff_t’
     ptrdiff_t n1 = THTensor_(nElement)(I1);     \
     ^
/tmp/luarocks_nn-scm-1-9230/nn/lib/THNN/generic/MSECriterion.c:35:3: note: in expansion of macro ‘THNN_CHECK_NELEMENT’
   THNN_CHECK_NELEMENT(input, target);
   ^
/tmp/luarocks_nn-scm-1-9230/nn/lib/THNN/init.c:19:5: error: unknown type name ‘ptrdiff_t’
     ptrdiff_t n2 = THTensor_(nElement)(I2);                                 \
     ^
/tmp/luarocks_nn-scm-1-9230/nn/lib/THNN/generic/MSECriterion.c:35:3: note: in expansion of macro ‘THNN_CHECK_NELEMENT’
   THNN_CHECK_NELEMENT(input, target);
   ^
/tmp/luarocks_nn-scm-1-9230/nn/lib/THNN/generic/MSECriterion.c: In function ‘THNN_DoubleMSECriterion_updateOutput’:
/tmp/luarocks_nn-scm-1-9230/nn/lib/THNN/init.c:18:5: error: unknown type name ‘ptrdiff_t’
     ptrdiff_t n1 = THTensor_(nElement)(I1);     \
     ^
/tmp/luarocks_nn-scm-1-9230/nn/lib/THNN/generic/MSECriterion.c:12:3: note: in expansion of macro ‘THNN_CHECK_NELEMENT’
   THNN_CHECK_NELEMENT(input, target);
   ^
/tmp/luarocks_nn-scm-1-9230/nn/lib/THNN/init.c:19:5: error: unknown type name ‘ptrdiff_t’
     ptrdiff_t n2 = THTensor_(nElement)(I2);                                 \
     ^
/tmp/luarocks_nn-scm-1-9230/nn/lib/THNN/generic/MSECriterion.c:12:3: note: in expansion of macro ‘THNN_CHECK_NELEMENT’
   THNN_CHECK_NELEMENT(input, target);
   ^
/tmp/luarocks_nn-scm-1-9230/nn/lib/THNN/generic/MSECriterion.c: In function ‘THNN_DoubleMSECriterion_updateGradInput’:
/tmp/luarocks_nn-scm-1-9230/nn/lib/THNN/init.c:18:5: error: unknown type name ‘ptrdiff_t’
     ptrdiff_t n1 = THTensor_(nElement)(I1);     \
     ^
/tmp/luarocks_nn-scm-1-9230/nn/lib/THNN/generic/MSECriterion.c:35:3: note: in expansion of macro ‘THNN_CHECK_NELEMENT’
   THNN_CHECK_NELEMENT(input, target);
   ^
/tmp/luarocks_nn-scm-1-9230/nn/lib/THNN/init.c:19:5: error: unknown type name ‘ptrdiff_t’
     ptrdiff_t n2 = THTensor_(nElement)(I2);                                 \
     ^
/tmp/luarocks_nn-scm-1-9230/nn/lib/THNN/generic/MSECriterion.c:35:3: note: in expansion of macro ‘THNN_CHECK_NELEMENT’
   THNN_CHECK_NELEMENT(input, target);
   ^
/tmp/luarocks_nn-scm-1-9230/nn/lib/THNN/generic/MarginCriterion.c: In function ‘THNN_FloatMarginCriterion_updateOutput’:
/tmp/luarocks_nn-scm-1-9230/nn/lib/THNN/init.c:18:5: error: unknown type name ‘ptrdiff_t’
     ptrdiff_t n1 = THTensor_(nElement)(I1);     \
     ^
/tmp/luarocks_nn-scm-1-9230/nn/lib/THNN/generic/MarginCriterion.c:13:3: note: in expansion of macro ‘THNN_CHECK_NELEMENT’
   THNN_CHECK_NELEMENT(input, target);
   ^
/tmp/luarocks_nn-scm-1-9230/nn/lib/THNN/init.c:19:5: error: unknown type name ‘ptrdiff_t’
     ptrdiff_t n2 = THTensor_(nElement)(I2);                                 \
     ^
/tmp/luarocks_nn-scm-1-9230/nn/lib/THNN/generic/MarginCriterion.c:13:3: note: in expansion of macro ‘THNN_CHECK_NELEMENT’
   THNN_CHECK_NELEMENT(input, target);
   ^
/tmp/luarocks_nn-scm-1-9230/nn/lib/THNN/generic/MarginCriterion.c: In function ‘THNN_FloatMarginCriterion_updateGradInput’:
/tmp/luarocks_nn-scm-1-9230/nn/lib/THNN/init.c:18:5: error: unknown type name ‘ptrdiff_t’
     ptrdiff_t n1 = THTensor_(nElement)(I1);     \
     ^
/tmp/luarocks_nn-scm-1-9230/nn/lib/THNN/generic/MarginCriterion.c:36:3: note: in expansion of macro ‘THNN_CHECK_NELEMENT’
   THNN_CHECK_NELEMENT(input, target);  
   ^
/tmp/luarocks_nn-scm-1-9230/nn/lib/THNN/init.c:19:5: error: unknown type name ‘ptrdiff_t’
     ptrdiff_t n2 = THTensor_(nElement)(I2);                                 \
     ^
/tmp/luarocks_nn-scm-1-9230/nn/lib/THNN/generic/MarginCriterion.c:36:3: note: in expansion of macro ‘THNN_CHECK_NELEMENT’
   THNN_CHECK_NELEMENT(input, target);  
   ^
/tmp/luarocks_nn-scm-1-9230/nn/lib/THNN/generic/MarginCriterion.c: In function ‘THNN_DoubleMarginCriterion_updateOutput’:
/tmp/luarocks_nn-scm-1-9230/nn/lib/THNN/init.c:18:5: error: unknown type name ‘ptrdiff_t’
     ptrdiff_t n1 = THTensor_(nElement)(I1);     \
     ^
/tmp/luarocks_nn-scm-1-9230/nn/lib/THNN/generic/MarginCriterion.c:13:3: note: in expansion of macro ‘THNN_CHECK_NELEMENT’
   THNN_CHECK_NELEMENT(input, target);
   ^
/tmp/luarocks_nn-scm-1-9230/nn/lib/THNN/init.c:19:5: error: unknown type name ‘ptrdiff_t’
     ptrdiff_t n2 = THTensor_(nElement)(I2);                                 \
     ^
/tmp/luarocks_nn-scm-1-9230/nn/lib/THNN/generic/MarginCriterion.c:13:3: note: in expansion of macro ‘THNN_CHECK_NELEMENT’
   THNN_CHECK_NELEMENT(input, target);
   ^
/tmp/luarocks_nn-scm-1-9230/nn/lib/THNN/generic/MarginCriterion.c: In function ‘THNN_DoubleMarginCriterion_updateGradInput’:
/tmp/luarocks_nn-scm-1-9230/nn/lib/THNN/init.c:18:5: error: unknown type name ‘ptrdiff_t’
     ptrdiff_t n1 = THTensor_(nElement)(I1);     \
     ^
/tmp/luarocks_nn-scm-1-9230/nn/lib/THNN/generic/MarginCriterion.c:36:3: note: in expansion of macro ‘THNN_CHECK_NELEMENT’
   THNN_CHECK_NELEMENT(input, target);  
   ^
/tmp/luarocks_nn-scm-1-9230/nn/lib/THNN/init.c:19:5: error: unknown type name ‘ptrdiff_t’
     ptrdiff_t n2 = THTensor_(nElement)(I2);                                 \
     ^
/tmp/luarocks_nn-scm-1-9230/nn/lib/THNN/generic/MarginCriterion.c:36:3: note: in expansion of macro ‘THNN_CHECK_NELEMENT’
   THNN_CHECK_NELEMENT(input, target);  
   ^
/tmp/luarocks_nn-scm-1-9230/nn/lib/THNN/generic/SoftMarginCriterion.c: In function ‘THNN_FloatSoftMarginCriterion_updateOutput’:
/tmp/luarocks_nn-scm-1-9230/nn/lib/THNN/init.c:18:5: error: unknown type name ‘ptrdiff_t’
     ptrdiff_t n1 = THTensor_(nElement)(I1);     \
     ^
/tmp/luarocks_nn-scm-1-9230/nn/lib/THNN/generic/SoftMarginCriterion.c:12:3: note: in expansion of macro ‘THNN_CHECK_NELEMENT’
   THNN_CHECK_NELEMENT(input, target);
   ^
/tmp/luarocks_nn-scm-1-9230/nn/lib/THNN/init.c:19:5: error: unknown type name ‘ptrdiff_t’
     ptrdiff_t n2 = THTensor_(nElement)(I2);                                 \
     ^
/tmp/luarocks_nn-scm-1-9230/nn/lib/THNN/generic/SoftMarginCriterion.c:12:3: note: in expansion of macro ‘THNN_CHECK_NELEMENT’
   THNN_CHECK_NELEMENT(input, target);
   ^
/tmp/luarocks_nn-scm-1-9230/nn/lib/THNN/generic/SoftMarginCriterion.c: In function ‘THNN_FloatSoftMarginCriterion_updateGradInput’:
/tmp/luarocks_nn-scm-1-9230/nn/lib/THNN/init.c:18:5: error: unknown type name ‘ptrdiff_t’
     ptrdiff_t n1 = THTensor_(nElement)(I1);     \
     ^
/tmp/luarocks_nn-scm-1-9230/nn/lib/THNN/generic/SoftMarginCriterion.c:35:3: note: in expansion of macro ‘THNN_CHECK_NELEMENT’
   THNN_CHECK_NELEMENT(input, target);
   ^
/tmp/luarocks_nn-scm-1-9230/nn/lib/THNN/init.c:19:5: error: unknown type name ‘ptrdiff_t’
     ptrdiff_t n2 = THTensor_(nElement)(I2);                                 \
     ^
/tmp/luarocks_nn-scm-1-9230/nn/lib/THNN/generic/SoftMarginCriterion.c:35:3: note: in expansion of macro ‘THNN_CHECK_NELEMENT’
   THNN_CHECK_NELEMENT(input, target);
   ^
/tmp/luarocks_nn-scm-1-9230/nn/lib/THNN/generic/SoftMarginCriterion.c: In function ‘THNN_DoubleSoftMarginCriterion_updateOutput’:
/tmp/luarocks_nn-scm-1-9230/nn/lib/THNN/init.c:18:5: error: unknown type name ‘ptrdiff_t’
     ptrdiff_t n1 = THTensor_(nElement)(I1);     \
     ^
/tmp/luarocks_nn-scm-1-9230/nn/lib/THNN/generic/SoftMarginCriterion.c:12:3: note: in expansion of macro ‘THNN_CHECK_NELEMENT’
   THNN_CHECK_NELEMENT(input, target);
   ^
/tmp/luarocks_nn-scm-1-9230/nn/lib/THNN/init.c:19:5: error: unknown type name ‘ptrdiff_t’
     ptrdiff_t n2 = THTensor_(nElement)(I2);                                 \
     ^
/tmp/luarocks_nn-scm-1-9230/nn/lib/THNN/generic/SoftMarginCriterion.c:12:3: note: in expansion of macro ‘THNN_CHECK_NELEMENT’
   THNN_CHECK_NELEMENT(input, target);
   ^
/tmp/luarocks_nn-scm-1-9230/nn/lib/THNN/generic/SoftMarginCriterion.c: In function ‘THNN_DoubleSoftMarginCriterion_updateGradInput’:
/tmp/luarocks_nn-scm-1-9230/nn/lib/THNN/init.c:18:5: error: unknown type name ‘ptrdiff_t’
     ptrdiff_t n1 = THTensor_(nElement)(I1);     \
     ^
/tmp/luarocks_nn-scm-1-9230/nn/lib/THNN/generic/SoftMarginCriterion.c:35:3: note: in expansion of macro ‘THNN_CHECK_NELEMENT’
   THNN_CHECK_NELEMENT(input, target);
   ^
/tmp/luarocks_nn-scm-1-9230/nn/lib/THNN/init.c:19:5: error: unknown type name ‘ptrdiff_t’
     ptrdiff_t n2 = THTensor_(nElement)(I2);                                 \
     ^
/tmp/luarocks_nn-scm-1-9230/nn/lib/THNN/generic/SoftMarginCriterion.c:35:3: note: in expansion of macro ‘THNN_CHECK_NELEMENT’
   THNN_CHECK_NELEMENT(input, target);
   ^
/tmp/luarocks_nn-scm-1-9230/nn/lib/THNN/generic/PReLU.c: In function ‘THNN_FloatPReLU_updateGradInput’:
/tmp/luarocks_nn-scm-1-9230/nn/lib/THNN/init.c:18:5: error: unknown type name ‘ptrdiff_t’
     ptrdiff_t n1 = THTensor_(nElement)(I1);     \
     ^
/tmp/luarocks_nn-scm-1-9230/nn/lib/THNN/generic/PReLU.c:79:3: note: in expansion of macro ‘THNN_CHECK_NELEMENT’
   THNN_CHECK_NELEMENT(input, gradOutput);
   ^
/tmp/luarocks_nn-scm-1-9230/nn/lib/THNN/init.c:19:5: error: unknown type name ‘ptrdiff_t’
     ptrdiff_t n2 = THTensor_(nElement)(I2);                                 \
     ^
/tmp/luarocks_nn-scm-1-9230/nn/lib/THNN/generic/PReLU.c:79:3: note: in expansion of macro ‘THNN_CHECK_NELEMENT’
   THNN_CHECK_NELEMENT(input, gradOutput);
   ^
/tmp/luarocks_nn-scm-1-9230/nn/lib/THNN/generic/PReLU.c: In function ‘THNN_FloatPReLU_accGradParameters’:
/tmp/luarocks_nn-scm-1-9230/nn/lib/THNN/init.c:18:5: error: unknown type name ‘ptrdiff_t’
     ptrdiff_t n1 = THTensor_(nElement)(I1);     \
     ^
/tmp/luarocks_nn-scm-1-9230/nn/lib/THNN/generic/PReLU.c:164:3: note: in expansion of macro ‘THNN_CHECK_NELEMENT’
   THNN_CHECK_NELEMENT(input, gradOutput);  
   ^
/tmp/luarocks_nn-scm-1-9230/nn/lib/THNN/init.c:19:5: error: unknown type name ‘ptrdiff_t’
     ptrdiff_t n2 = THTensor_(nElement)(I2);                                 \
     ^
/tmp/luarocks_nn-scm-1-9230/nn/lib/THNN/generic/PReLU.c:164:3: note: in expansion of macro ‘THNN_CHECK_NELEMENT’
   THNN_CHECK_NELEMENT(input, gradOutput);  
   ^
/tmp/luarocks_nn-scm-1-9230/nn/lib/THNN/generic/PReLU.c: In function ‘THNN_DoublePReLU_updateGradInput’:
/tmp/luarocks_nn-scm-1-9230/nn/lib/THNN/init.c:18:5: error: unknown type name ‘ptrdiff_t’
     ptrdiff_t n1 = THTensor_(nElement)(I1);     \
     ^
/tmp/luarocks_nn-scm-1-9230/nn/lib/THNN/generic/PReLU.c:79:3: note: in expansion of macro ‘THNN_CHECK_NELEMENT’
   THNN_CHECK_NELEMENT(input, gradOutput);
   ^
/tmp/luarocks_nn-scm-1-9230/nn/lib/THNN/init.c:19:5: error: unknown type name ‘ptrdiff_t’
     ptrdiff_t n2 = THTensor_(nElement)(I2);                                 \
     ^
/tmp/luarocks_nn-scm-1-9230/nn/lib/THNN/generic/PReLU.c:79:3: note: in expansion of macro ‘THNN_CHECK_NELEMENT’
   THNN_CHECK_NELEMENT(input, gradOutput);
   ^
/tmp/luarocks_nn-scm-1-9230/nn/lib/THNN/generic/PReLU.c: In function ‘THNN_DoublePReLU_accGradParameters’:
/tmp/luarocks_nn-scm-1-9230/nn/lib/THNN/init.c:18:5: error: unknown type name ‘ptrdiff_t’
     ptrdiff_t n1 = THTensor_(nElement)(I1);     \
     ^
/tmp/luarocks_nn-scm-1-9230/nn/lib/THNN/generic/PReLU.c:164:3: note: in expansion of macro ‘THNN_CHECK_NELEMENT’
   THNN_CHECK_NELEMENT(input, gradOutput);  
   ^
/tmp/luarocks_nn-scm-1-9230/nn/lib/THNN/init.c:19:5: error: unknown type name ‘ptrdiff_t’
     ptrdiff_t n2 = THTensor_(nElement)(I2);                                 \
     ^
/tmp/luarocks_nn-scm-1-9230/nn/lib/THNN/generic/PReLU.c:164:3: note: in expansion of macro ‘THNN_CHECK_NELEMENT’
   THNN_CHECK_NELEMENT(input, gradOutput);  
   ^
/tmp/luarocks_nn-scm-1-9230/nn/lib/THNN/generic/RReLU.c: In function ‘THNN_FloatRReLU_updateGradInput’:
/tmp/luarocks_nn-scm-1-9230/nn/lib/THNN/init.c:18:5: error: unknown type name ‘ptrdiff_t’
     ptrdiff_t n1 = THTensor_(nElement)(I1);     \
     ^
/tmp/luarocks_nn-scm-1-9230/nn/lib/THNN/generic/RReLU.c:89:3: note: in expansion of macro ‘THNN_CHECK_NELEMENT’
   THNN_CHECK_NELEMENT(input, gradOutput);
   ^
/tmp/luarocks_nn-scm-1-9230/nn/lib/THNN/init.c:19:5: error: unknown type name ‘ptrdiff_t’
     ptrdiff_t n2 = THTensor_(nElement)(I2);                                 \
     ^
/tmp/luarocks_nn-scm-1-9230/nn/lib/THNN/generic/RReLU.c:89:3: note: in expansion of macro ‘THNN_CHECK_NELEMENT’
   THNN_CHECK_NELEMENT(input, gradOutput);
   ^
/tmp/luarocks_nn-scm-1-9230/nn/lib/THNN/generic/RReLU.c: In function ‘THNN_DoubleRReLU_updateGradInput’:
/tmp/luarocks_nn-scm-1-9230/nn/lib/THNN/init.c:18:5: error: unknown type name ‘ptrdiff_t’
     ptrdiff_t n1 = THTensor_(nElement)(I1);     \
     ^
/tmp/luarocks_nn-scm-1-9230/nn/lib/THNN/generic/RReLU.c:89:3: note: in expansion of macro ‘THNN_CHECK_NELEMENT’
   THNN_CHECK_NELEMENT(input, gradOutput);
   ^
/tmp/luarocks_nn-scm-1-9230/nn/lib/THNN/init.c:19:5: error: unknown type name ‘ptrdiff_t’
     ptrdiff_t n2 = THTensor_(nElement)(I2);                                 \
     ^
/tmp/luarocks_nn-scm-1-9230/nn/lib/THNN/generic/RReLU.c:89:3: note: in expansion of macro ‘THNN_CHECK_NELEMENT’
   THNN_CHECK_NELEMENT(input, gradOutput);
   ^
/tmp/luarocks_nn-scm-1-9230/nn/lib/THNN/generic/Sigmoid.c: In function ‘THNN_FloatSigmoid_updateGradInput’:
/tmp/luarocks_nn-scm-1-9230/nn/lib/THNN/init.c:18:5: error: unknown type name ‘ptrdiff_t’
     ptrdiff_t n1 = THTensor_(nElement)(I1);     \
     ^
/tmp/luarocks_nn-scm-1-9230/nn/lib/THNN/generic/Sigmoid.c:24:3: note: in expansion of macro ‘THNN_CHECK_NELEMENT’
   THNN_CHECK_NELEMENT(input, gradOutput);
   ^
/tmp/luarocks_nn-scm-1-9230/nn/lib/THNN/init.c:19:5: error: unknown type name ‘ptrdiff_t’
     ptrdiff_t n2 = THTensor_(nElement)(I2);                                 \
     ^
/tmp/luarocks_nn-scm-1-9230/nn/lib/THNN/generic/Sigmoid.c:24:3: note: in expansion of macro ‘THNN_CHECK_NELEMENT’
   THNN_CHECK_NELEMENT(input, gradOutput);
   ^
/tmp/luarocks_nn-scm-1-9230/nn/lib/THNN/generic/Sigmoid.c: In function ‘THNN_DoubleSigmoid_updateGradInput’:
/tmp/luarocks_nn-scm-1-9230/nn/lib/THNN/init.c:18:5: error: unknown type name ‘ptrdiff_t’
     ptrdiff_t n1 = THTensor_(nElement)(I1);     \
     ^
/tmp/luarocks_nn-scm-1-9230/nn/lib/THNN/generic/Sigmoid.c:24:3: note: in expansion of macro ‘THNN_CHECK_NELEMENT’
   THNN_CHECK_NELEMENT(input, gradOutput);
   ^
/tmp/luarocks_nn-scm-1-9230/nn/lib/THNN/init.c:19:5: error: unknown type name ‘ptrdiff_t’
     ptrdiff_t n2 = THTensor_(nElement)(I2);                                 \
     ^
/tmp/luarocks_nn-scm-1-9230/nn/lib/THNN/generic/Sigmoid.c:24:3: note: in expansion of macro ‘THNN_CHECK_NELEMENT’
   THNN_CHECK_NELEMENT(input, gradOutput);
   ^
/tmp/luarocks_nn-scm-1-9230/nn/lib/THNN/generic/SmoothL1Criterion.c: In function ‘THNN_FloatSmoothL1Criterion_updateOutput’:
/tmp/luarocks_nn-scm-1-9230/nn/lib/THNN/init.c:18:5: error: unknown type name ‘ptrdiff_t’
     ptrdiff_t n1 = THTensor_(nElement)(I1);     \
     ^
/tmp/luarocks_nn-scm-1-9230/nn/lib/THNN/generic/SmoothL1Criterion.c:12:3: note: in expansion of macro ‘THNN_CHECK_NELEMENT’
   THNN_CHECK_NELEMENT(input, target);
   ^
/tmp/luarocks_nn-scm-1-9230/nn/lib/THNN/init.c:19:5: error: unknown type name ‘ptrdiff_t’
     ptrdiff_t n2 = THTensor_(nElement)(I2);                                 \
     ^
/tmp/luarocks_nn-scm-1-9230/nn/lib/THNN/generic/SmoothL1Criterion.c:12:3: note: in expansion of macro ‘THNN_CHECK_NELEMENT’
   THNN_CHECK_NELEMENT(input, target);
   ^
/tmp/luarocks_nn-scm-1-9230/nn/lib/THNN/generic/SmoothL1Criterion.c: In function ‘THNN_FloatSmoothL1Criterion_updateGradInput’:
/tmp/luarocks_nn-scm-1-9230/nn/lib/THNN/init.c:18:5: error: unknown type name ‘ptrdiff_t’
     ptrdiff_t n1 = THTensor_(nElement)(I1);     \
     ^
/tmp/luarocks_nn-scm-1-9230/nn/lib/THNN/generic/SmoothL1Criterion.c:34:3: note: in expansion of macro ‘THNN_CHECK_NELEMENT’
   THNN_CHECK_NELEMENT(input, target);
   ^
/tmp/luarocks_nn-scm-1-9230/nn/lib/THNN/init.c:19:5: error: unknown type name ‘ptrdiff_t’
     ptrdiff_t n2 = THTensor_(nElement)(I2);                                 \
     ^
/tmp/luarocks_nn-scm-1-9230/nn/lib/THNN/generic/SmoothL1Criterion.c:34:3: note: in expansion of macro ‘THNN_CHECK_NELEMENT’
   THNN_CHECK_NELEMENT(input, target);
   ^
/tmp/luarocks_nn-scm-1-9230/nn/lib/THNN/generic/SmoothL1Criterion.c: In function ‘THNN_DoubleSmoothL1Criterion_updateOutput’:
/tmp/luarocks_nn-scm-1-9230/nn/lib/THNN/init.c:18:5: error: unknown type name ‘ptrdiff_t’
     ptrdiff_t n1 = THTensor_(nElement)(I1);     \
     ^
/tmp/luarocks_nn-scm-1-9230/nn/lib/THNN/generic/SmoothL1Criterion.c:12:3: note: in expansion of macro ‘THNN_CHECK_NELEMENT’
   THNN_CHECK_NELEMENT(input, target);
   ^
/tmp/luarocks_nn-scm-1-9230/nn/lib/THNN/init.c:19:5: error: unknown type name ‘ptrdiff_t’
     ptrdiff_t n2 = THTensor_(nElement)(I2);                                 \
     ^
/tmp/luarocks_nn-scm-1-9230/nn/lib/THNN/generic/SmoothL1Criterion.c:12:3: note: in expansion of macro ‘THNN_CHECK_NELEMENT’
   THNN_CHECK_NELEMENT(input, target);
   ^
/tmp/luarocks_nn-scm-1-9230/nn/lib/THNN/generic/SmoothL1Criterion.c: In function ‘THNN_DoubleSmoothL1Criterion_updateGradInput’:
/tmp/luarocks_nn-scm-1-9230/nn/lib/THNN/init.c:18:5: error: unknown type name ‘ptrdiff_t’
     ptrdiff_t n1 = THTensor_(nElement)(I1);     \
     ^
/tmp/luarocks_nn-scm-1-9230/nn/lib/THNN/generic/SmoothL1Criterion.c:34:3: note: in expansion of macro ‘THNN_CHECK_NELEMENT’
   THNN_CHECK_NELEMENT(input, target);
   ^
/tmp/luarocks_nn-scm-1-9230/nn/lib/THNN/init.c:19:5: error: unknown type name ‘ptrdiff_t’
     ptrdiff_t n2 = THTensor_(nElement)(I2);                                 \
     ^
/tmp/luarocks_nn-scm-1-9230/nn/lib/THNN/generic/SmoothL1Criterion.c:34:3: note: in expansion of macro ‘THNN_CHECK_NELEMENT’
   THNN_CHECK_NELEMENT(input, target);
   ^
In file included from generic/SoftMax.c:1:0,
                 from /tmp/luarocks_nn-scm-1-9230/nn/lib/THNN/init.c:114:
/tmp/luarocks_nn-scm-1-9230/nn/lib/THNN/generic/SoftMax.c: In function ‘THNN_FloatSoftMax_updateOutput’:
/tmp/luarocks_nn-scm-1-9230/nn/lib/THNN/generic/SoftMax.c:11:3: error: unknown type name ‘ptrdiff_t’
   ptrdiff_t nframe = 0, dim = 0, stride = 0;
   ^
/tmp/luarocks_nn-scm-1-9230/nn/lib/THNN/generic/SoftMax.c:12:3: error: unknown type name ‘ptrdiff_t’
   ptrdiff_t t;
   ^
/tmp/luarocks_nn-scm-1-9230/nn/lib/THNN/generic/SoftMax.c:58:5: error: unknown type name ‘ptrdiff_t’
     ptrdiff_t d;
     ^
/tmp/luarocks_nn-scm-1-9230/nn/lib/THNN/generic/SoftMax.c: In function ‘THNN_FloatSoftMax_updateGradInput’:
/tmp/luarocks_nn-scm-1-9230/nn/lib/THNN/generic/SoftMax.c:90:3: error: unknown type name ‘ptrdiff_t’
   ptrdiff_t nframe = 0, dim = 0, stride = 0;
   ^
/tmp/luarocks_nn-scm-1-9230/nn/lib/THNN/generic/SoftMax.c:91:3: error: unknown type name ‘ptrdiff_t’
   ptrdiff_t t;
   ^
/tmp/luarocks_nn-scm-1-9230/nn/lib/THNN/generic/SoftMax.c:137:5: error: unknown type name ‘ptrdiff_t’
     ptrdiff_t d;
     ^
In file included from generic/SoftMax.c:1:0,
                 from /tmp/luarocks_nn-scm-1-9230/nn/lib/THNN/init.c:114:
/tmp/luarocks_nn-scm-1-9230/nn/lib/THNN/generic/SoftMax.c: In function ‘THNN_DoubleSoftMax_updateOutput’:
/tmp/luarocks_nn-scm-1-9230/nn/lib/THNN/generic/SoftMax.c:11:3: error: unknown type name ‘ptrdiff_t’
   ptrdiff_t nframe = 0, dim = 0, stride = 0;
   ^
/tmp/luarocks_nn-scm-1-9230/nn/lib/THNN/generic/SoftMax.c:12:3: error: unknown type name ‘ptrdiff_t’
   ptrdiff_t t;
   ^
/tmp/luarocks_nn-scm-1-9230/nn/lib/THNN/generic/SoftMax.c:58:5: error: unknown type name ‘ptrdiff_t’
     ptrdiff_t d;
     ^
/tmp/luarocks_nn-scm-1-9230/nn/lib/THNN/generic/SoftMax.c: In function ‘THNN_DoubleSoftMax_updateGradInput’:
/tmp/luarocks_nn-scm-1-9230/nn/lib/THNN/generic/SoftMax.c:90:3: error: unknown type name ‘ptrdiff_t’
   ptrdiff_t nframe = 0, dim = 0, stride = 0;
   ^
/tmp/luarocks_nn-scm-1-9230/nn/lib/THNN/generic/SoftMax.c:91:3: error: unknown type name ‘ptrdiff_t’
   ptrdiff_t t;
   ^
/tmp/luarocks_nn-scm-1-9230/nn/lib/THNN/generic/SoftMax.c:137:5: error: unknown type name ‘ptrdiff_t’
     ptrdiff_t d;
     ^
/tmp/luarocks_nn-scm-1-9230/nn/lib/THNN/generic/SoftPlus.c: In function ‘THNN_FloatSoftPlus_updateGradInput’:
/tmp/luarocks_nn-scm-1-9230/nn/lib/THNN/init.c:18:5: error: unknown type name ‘ptrdiff_t’
     ptrdiff_t n1 = THTensor_(nElement)(I1);     \
     ^
/tmp/luarocks_nn-scm-1-9230/nn/lib/THNN/generic/SoftPlus.c:29:3: note: in expansion of macro ‘THNN_CHECK_NELEMENT’
   THNN_CHECK_NELEMENT(input, gradOutput);
   ^
/tmp/luarocks_nn-scm-1-9230/nn/lib/THNN/init.c:19:5: error: unknown type name ‘ptrdiff_t’
     ptrdiff_t n2 = THTensor_(nElement)(I2);                                 \
     ^
/tmp/luarocks_nn-scm-1-9230/nn/lib/THNN/generic/SoftPlus.c:29:3: note: in expansion of macro ‘THNN_CHECK_NELEMENT’
   THNN_CHECK_NELEMENT(input, gradOutput);
   ^
/tmp/luarocks_nn-scm-1-9230/nn/lib/THNN/generic/SoftPlus.c: In function ‘THNN_DoubleSoftPlus_updateGradInput’:
/tmp/luarocks_nn-scm-1-9230/nn/lib/THNN/init.c:18:5: error: unknown type name ‘ptrdiff_t’
     ptrdiff_t n1 = THTensor_(nElement)(I1);     \
     ^
/tmp/luarocks_nn-scm-1-9230/nn/lib/THNN/generic/SoftPlus.c:29:3: note: in expansion of macro ‘THNN_CHECK_NELEMENT’
   THNN_CHECK_NELEMENT(input, gradOutput);
   ^
/tmp/luarocks_nn-scm-1-9230/nn/lib/THNN/init.c:19:5: error: unknown type name ‘ptrdiff_t’
     ptrdiff_t n2 = THTensor_(nElement)(I2);                                 \
     ^
/tmp/luarocks_nn-scm-1-9230/nn/lib/THNN/generic/SoftPlus.c:29:3: note: in expansion of macro ‘THNN_CHECK_NELEMENT’
   THNN_CHECK_NELEMENT(input, gradOutput);
   ^
/tmp/luarocks_nn-scm-1-9230/nn/lib/THNN/generic/SoftShrink.c: In function ‘THNN_FloatSoftShrink_updateGradInput’:
/tmp/luarocks_nn-scm-1-9230/nn/lib/THNN/init.c:18:5: error: unknown type name ‘ptrdiff_t’
     ptrdiff_t n1 = THTensor_(nElement)(I1);     \
     ^
/tmp/luarocks_nn-scm-1-9230/nn/lib/THNN/generic/SoftShrink.c:30:3: note: in expansion of macro ‘THNN_CHECK_NELEMENT’
   THNN_CHECK_NELEMENT(input, gradOutput);
   ^
/tmp/luarocks_nn-scm-1-9230/nn/lib/THNN/init.c:19:5: error: unknown type name ‘ptrdiff_t’
     ptrdiff_t n2 = THTensor_(nElement)(I2);                                 \
     ^
/tmp/luarocks_nn-scm-1-9230/nn/lib/THNN/generic/SoftShrink.c:30:3: note: in expansion of macro ‘THNN_CHECK_NELEMENT’
   THNN_CHECK_NELEMENT(input, gradOutput);
   ^
/tmp/luarocks_nn-scm-1-9230/nn/lib/THNN/generic/SoftShrink.c: In function ‘THNN_DoubleSoftShrink_updateGradInput’:
/tmp/luarocks_nn-scm-1-9230/nn/lib/THNN/init.c:18:5: error: unknown type name ‘ptrdiff_t’
     ptrdiff_t n1 = THTensor_(nElement)(I1);     \
     ^
/tmp/luarocks_nn-scm-1-9230/nn/lib/THNN/generic/SoftShrink.c:30:3: note: in expansion of macro ‘THNN_CHECK_NELEMENT’
   THNN_CHECK_NELEMENT(input, gradOutput);
   ^
/tmp/luarocks_nn-scm-1-9230/nn/lib/THNN/init.c:19:5: error: unknown type name ‘ptrdiff_t’
     ptrdiff_t n2 = THTensor_(nElement)(I2);                                 \
     ^
/tmp/luarocks_nn-scm-1-9230/nn/lib/THNN/generic/SoftShrink.c:30:3: note: in expansion of macro ‘THNN_CHECK_NELEMENT’
   THNN_CHECK_NELEMENT(input, gradOutput);
   ^
/tmp/luarocks_nn-scm-1-9230/nn/lib/THNN/generic/Threshold.c: In function ‘THNN_FloatThreshold_updateGradInput’:
/tmp/luarocks_nn-scm-1-9230/nn/lib/THNN/init.c:18:5: error: unknown type name ‘ptrdiff_t’
     ptrdiff_t n1 = THTensor_(nElement)(I1);     \
     ^
/tmp/luarocks_nn-scm-1-9230/nn/lib/THNN/generic/Threshold.c:39:3: note: in expansion of macro ‘THNN_CHECK_NELEMENT’
   THNN_CHECK_NELEMENT(input, gradOutput);
   ^
/tmp/luarocks_nn-scm-1-9230/nn/lib/THNN/init.c:19:5: error: unknown type name ‘ptrdiff_t’
     ptrdiff_t n2 = THTensor_(nElement)(I2);                                 \
     ^
/tmp/luarocks_nn-scm-1-9230/nn/lib/THNN/generic/Threshold.c:39:3: note: in expansion of macro ‘THNN_CHECK_NELEMENT’
   THNN_CHECK_NELEMENT(input, gradOutput);
   ^
/tmp/luarocks_nn-scm-1-9230/nn/lib/THNN/generic/Threshold.c: In function ‘THNN_DoubleThreshold_updateGradInput’:
/tmp/luarocks_nn-scm-1-9230/nn/lib/THNN/init.c:18:5: error: unknown type name ‘ptrdiff_t’
     ptrdiff_t n1 = THTensor_(nElement)(I1);     \
     ^
/tmp/luarocks_nn-scm-1-9230/nn/lib/THNN/generic/Threshold.c:39:3: note: in expansion of macro ‘THNN_CHECK_NELEMENT’
   THNN_CHECK_NELEMENT(input, gradOutput);
   ^
/tmp/luarocks_nn-scm-1-9230/nn/lib/THNN/init.c:19:5: error: unknown type name ‘ptrdiff_t’
     ptrdiff_t n2 = THTensor_(nElement)(I2);                                 \
     ^
/tmp/luarocks_nn-scm-1-9230/nn/lib/THNN/generic/Threshold.c:39:3: note: in expansion of macro ‘THNN_CHECK_NELEMENT’
   THNN_CHECK_NELEMENT(input, gradOutput);
   ^
In file included from generic/BatchNormalization.c:1:0,
                 from /tmp/luarocks_nn-scm-1-9230/nn/lib/THNN/init.c:147:
/tmp/luarocks_nn-scm-1-9230/nn/lib/THNN/generic/BatchNormalization.c: In function ‘THNN_FloatBatchNormalization_updateOutput’:
/tmp/luarocks_nn-scm-1-9230/nn/lib/THNN/generic/BatchNormalization.c:15:3: error: unknown type name ‘ptrdiff_t’
   ptrdiff_t n = THTensor_(nElement)(input) / nInput;
   ^
/tmp/luarocks_nn-scm-1-9230/nn/lib/THNN/generic/BatchNormalization.c: In function ‘THNN_FloatBatchNormalization_backward’:
/tmp/luarocks_nn-scm-1-9230/nn/lib/THNN/generic/BatchNormalization.c:78:3: error: unknown type name ‘ptrdiff_t’
   ptrdiff_t n = THTensor_(nElement)(input) / nInput;
   ^
In file included from generic/BatchNormalization.c:1:0,
                 from /tmp/luarocks_nn-scm-1-9230/nn/lib/THNN/init.c:147:
/tmp/luarocks_nn-scm-1-9230/nn/lib/THNN/generic/BatchNormalization.c: In function ‘THNN_DoubleBatchNormalization_updateOutput’:
/tmp/luarocks_nn-scm-1-9230/nn/lib/THNN/generic/BatchNormalization.c:15:3: error: unknown type name ‘ptrdiff_t’
   ptrdiff_t n = THTensor_(nElement)(input) / nInput;
   ^
/tmp/luarocks_nn-scm-1-9230/nn/lib/THNN/generic/BatchNormalization.c: In function ‘THNN_DoubleBatchNormalization_backward’:
/tmp/luarocks_nn-scm-1-9230/nn/lib/THNN/generic/BatchNormalization.c:78:3: error: unknown type name ‘ptrdiff_t’
   ptrdiff_t n = THTensor_(nElement)(input) / nInput;
   ^
lib/THNN/CMakeFiles/THNN.dir/build.make:62: recipe for target 'lib/THNN/CMakeFiles/THNN.dir/init.c.o' failed
make[2]: *** [lib/THNN/CMakeFiles/THNN.dir/init.c.o] Error 1
CMakeFiles/Makefile2:103: recipe for target 'lib/THNN/CMakeFiles/THNN.dir/all' failed
make[1]: *** [lib/THNN/CMakeFiles/THNN.dir/all] Error 2
Makefile:127: recipe for target 'all' failed
make: *** [all] Error 2

Error: Build error: Failed building.

Jetpack 2.3

Compiling under Jetpack 2.3 resulted in the following error.
deepQLearner.cpp:13:18: fatal error: luat.h: No such file or directory.

I did try the pre-built package for Jetpack 2.2, and that seemed to run fine.

torch7 move to ATen?

Will this repository be moving from torch7 to ATen?

It seems torch7 is deprecated and ATen is recommended:
"Torch is not in active development"
https://github.com/torch/torch7/blob/master/README.md

I have real and significant issue with syntax,
and learning new languages is problematic.
Have Jetson Nano and scoping possible issues around implementing this repository
apologies if I am off-piste.

Does not compile with Gazebo 9

Hi,

thank you for reading this. I am trying to compile the code and have Gazebo 9 already installed and that may lead to the errors. I am on Ubuntu 16.04 and Pytorch from the master branch is already built from source.

martin@mars:~/Downloads/jetson-reinforcement/build$ make -j8

[huge error code]

make[2]: *** [gazebo/CMakeFiles/gazeboArmPlugin.dir/ArmPlugin.cpp.o] Error 1
CMakeFiles/Makefile2:205: recipe for target 'gazebo/CMakeFiles/gazeboArmPlugin.dir/all' failed
make[1]: *** [gazebo/CMakeFiles/gazeboArmPlugin.dir/all] Error 2
gazebo/CMakeFiles/gazeboRoverPlugin.dir/build.make:62: recipe for target 'gazebo/CMakeFiles/gazeboRoverPlugin.dir/RoverPlugin.cpp.o' failed
make[2]: *** [gazebo/CMakeFiles/gazeboRoverPlugin.dir/RoverPlugin.cpp.o] Error 1
CMakeFiles/Makefile2:167: recipe for target 'gazebo/CMakeFiles/gazeboRoverPlugin.dir/all' failed
make[1]: *** [gazebo/CMakeFiles/gazeboRoverPlugin.dir/all] Error 2
Makefile:83: recipe for target 'all' failed
make: *** [all] Error 2

python gym-DQN.py => RuntimeError: torch was compiled without numpy support

Hello,
After successfully build, with a fresh install of a Jetpack 3.0 on a TX2, when I try to run gym-DQN.py, I got this error:

$ python gym-DQN.py 
[2017-07-21 14:08:36,674] Making new env: CartPole-v0
Traceback (most recent call last):
  File "gym-DQN.py", line 280, in <module>
    plt.imshow(get_screen().cpu().squeeze(0).permute(1, 2, 0).numpy(),
  File "gym-DQN.py", line 274, in get_screen
    screen = torch.from_numpy(screen)
RuntimeError: torch was compiled without numpy support
/usr/local/lib/python2.7/dist-packages/matplotlib/backends/backend_gtk3.py:215: Warning: Source ID 8 was not found when attempting to remove it
  GLib.source_remove(self._idle_draw_id)

Also I had to install matplotlib for python:
$ sudo pip install --upgrade matplotlib
But it seems there is a problem with numpy.
Any idea on how to solve this issue ? Is there a list of pyhton modules that must be installed before the build ?
Thanks!

I need pytorch == 0.3.1

For project purpose, I need a pytorch with version 0.3.1, is that possible to change the version when I build from the source?

Before your installation steps, Should I install ROS, gazebo, gym, and even pip?

Before your installation steps, Should I install ROS, gazebo, gym, and even pip?
I installed ROS and gazebo before your installation steps.
After your installation steps. it showed no module gazebo and no pip.

Now I re-flashed my jetson tx2 with 3.2.1 jetpack. Before your installation steps, Should I install ROS, gazebo, gym, and even pip?
Thanks.

OpenBLAS error JetPack 2.3

Tried building from source with the latest JetPack and got a compiling error when the script was building OpenBLAS.

gemv.c: In function ‘sgemv_’:
gemv.c:223:29: error: ‘GEMM_MULTITHREAD_THRESHOLD’ undeclared (first use in this function)
   if ( 1L * m * n < 2304L * GEMM_MULTITHREAD_THRESHOLD )
                             ^
gemv.c:223:29: note: each undeclared identifier is reported only once for each function it appears in
Makefile:841: recipe for target 'sgemv.o' failed

Any idea how to get this working? Thanks!

problem building pytorch with jetson tx2

Hello,

make gave me the following error. cmake ../ seemed to have finished fine. I am using jetson TX2 L4T 28.2.0 with Ubuntu 16.04 and CUDA 9.0252

Scanning dependencies of target jetson-reinforcement
[ 40%] Building CXX object CMakeFiles/jetson-reinforcement.dir/c/pyTensor.cpp.o
In file included from /home/nvidia/jetson-reinforcement/c/pyTensor.cpp:6:0:
/home/nvidia/jetson-reinforcement/c/pyTorch.h:14:19: fatal error: TH/TH.h: No such file or directory
compilation terminated.
CMakeFiles/jetson-reinforcement.dir/build.make:69: recipe for target 'CMakeFiles/jetson-reinforcement.dir/c/pyTensor.cpp.o' failed
make[2]: *** [CMakeFiles/jetson-reinforcement.dir/c/pyTensor.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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.