0

I'm trying to run the pixel-cnn neural network available on github. Following the instructions in README.md I run the following code in cmd:

train.py -i ./data_dir/ -o ./save_dir -g 1

I'm using one gpu and created the two folders ./data_dir and ./save_dir within the same directory as train.py for loading & saving the data. When doing so I get the following error message:

tensorflow.python.framework.errors_impl.InvalidArgumentError: Cannot assign a device for operation model_1/ones: node model_1/ones (defined at \OneDrive - MNG\Matura Arbeit\Projects\pixel-cnn-master\pixel_cnn_pp\model.py:36) was explicitly assigned to /device:GPU:0 but available devices are [ /job:localhost/replica:0/task:0/device:CPU:0 ]. Make sure the device specification refers to a valid device. The requested device appears to be a GPU, but CUDA is not enabled.

It seems that the tensorflow doesn't recognise the GPU but when checking the devices available to tensorflow (as described here) both my CPU and GPU show up as "/device:CPU:0" and /device:GPU:0". Also, when running other programs with tensorflow-gpu it work perfectly fine.

I have installed tensorflow-gpu==1.14.0. As for the CUDA I'm pretty sure I have installed version 10.0, as shown by nvcc --version. Although when running nvidia-smi it shows that CUDA version 10.1 is installed.

(edited:)I am using an Anaconda evironment (Windows 10) with tensorflow-gpu==1.14.0. The GPU I'm using is a GTX 1050Ti with Max-Q Design and driver version 436.30. As for CUDA I'm pretty sure I have installed version 10.0, as shown by nvcc --version. Although when running nvidia-smi it shows that CUDA version 10.1 is installed.

  • Just checking your CUDA compute level of your card please? And are you able to run any tensorflow commands with the gpu version? – JCooke Sep 18 '19 at 16:40
  • @JCooke I'm using a GTX 1050Ti (with Max-Q Design). Cheking [this list](https://developer.nvidia.com/cuda-gpus) I now see that it isn't listed as compatible, which seems weird to me. Is this really the case, that the 1050Ti can't compute with CUDA? (Edit:) And yes, any other program I run works perfectly with tensorflow-gpu. – Manuel Antoinette Sep 18 '19 at 16:52
  • No I think it's just missing from the list. Should be supported. – JCooke Sep 18 '19 at 16:55
  • Are you using a virtual environment/conda? What version of CUDA are you pointing to in PATH? Please can you also update your question with a bit more info on your dev environment as this error can be caused by CUDA linking problems, although strange it is only happening on this file. – JCooke Sep 18 '19 at 17:04
  • @JCooke yes I'm using an anaconda environment (I updated the question accordingly). PATH is set to point to ...\CUDA\v10.0\bin and CUDA_PATH to ...\CUDA\v10.0. Furthermore, to check if tf-gpu was really working with other files, I quickly ran [this script](https://gist.github.com/j-min/baae1aa56e861cab9831b3722755ae6d#file-test_single_gpu-py), which executed perfectly fine with the GPU carrying all the load (checked it with task manager) – Manuel Antoinette Sep 18 '19 at 17:47

0 Answers0