I also changed the Torch version from nightly to release 1.0.1 and cuDNN to 7.4.2.24, but I still get the same error.
CUDA_VERSION='9.0'
CUDNN_VERSION='7.4.2.24'
PYTORCH_VERSION='1.0.1'
TORCHVISION_VERSION='0.2.2'

I also reduce the batch size to 1, and get the same error. The GPU is a Titan-V with 12GB HBM2 memory, and total GPU utilization is around 27%, so it isn’t an issue with running an older GPU.
  File "/project/ros-kinetic-alphapilot/catkin_ws/src/alphapilot_openai_ros/ardrone_race_track/src/ardrone_v1_start_training_ddqn.py", line 192, in optimize_model
    next_state_values[non_final_mask] = self.target_net(non_final_next_states).max(1)[0].detach()
  File "/usr/local/lib/python2.7/dist-packages/torch/nn/modules/module.py", line 489, in __call__
    result = self.forward(*input, **kwargs)
  File "/project/ros-kinetic-alphapilot/catkin_ws/src/alphapilot_openai_ros/ardrone_race_track/src/model/dqn/dqn.py", line 102, in forward
    x = F.relu(self.bn2(self.conv2(x)))
  File "/usr/local/lib/python2.7/dist-packages/torch/nn/functional.py", line 862, in relu
    result = torch.relu(input)
RuntimeError: CUDA error: device-side assert triggered
/pytorch/aten/src/THC/THCTensorScatterGather.cu:97: void THCudaTensor_gatherKernel(TensorInfo<Real, IndexType>, TensorInfo<Real, IndexType>, TensorInfo<long, IndexType>, int, IndexType) [with IndexType = unsigned int, Real = float, Dims = 2]: block: [0,0,0], thread: [0,0,0] Assertion `indexValue >= 0 && indexValue < src.sizes[dim]` failed.