TensorFlow 1.0和StyleGAN-InvalidArgumentError:无法分配设备进行操作

时间:2020-10-04 10:42:33

标签: python tensorflow keras generative-adversarial-network

我正在尝试在装有NVIDIA GeForce GTX 1650的笔记本电脑上运行Style GAN,并且正在遵循tutorial。我能够生成.tfrecord文件。之后,我尝试运行python train.py,但出现以下错误:

Building TensorFlow graph...

.... some warnings here

tensorflow.python.framework.errors_impl.InvalidArgumentError: Cannot assign a device for operation G_synthesis_2/lod: {{node G_synthesis_2/lod}} was explicitly assigned to /device:GPU:1 but available devices are [ /job:localhost/replica:0/task:0/device:CPU:0, /job:localhost/replica:0/task:0/device:GPU:0 ]. Make sure the device specification refers to a valid device.

.... stack of the errors

During handling of the above exception, another exception occurred:

.... stack of the errors

tensorflow.python.framework.errors_impl.InvalidArgumentError: Cannot assign a device for operation G_synthesis_2/lod: node G_synthesis_2/lod (defined at C:\Users\Acer\anaconda3\envs\tf\lib\site-packages\tensorflow_core\python\framework\ops.py:1748)  was explicitly assigned to /device:GPU:1 but available devices are [ /job:localhost/replica:0/task:0/device:CPU:0, /job:localhost/replica:0/task:0/device:GPU:0 ]. Make sure the device specification refers to a valid device.
         [[G_synthesis_2/lod]]

我使用:

  • Windows 10
  • NVIDIA GeForce GTX 1650
  • Python 3.7.9
  • tensorflow-gpu==1.15
  • CUDA 10.1
  • CUDNN 7.65
  • Conda虚拟环境。

我的尝试:

  1. 检查CUDA的环境变量
  2. 修复DLL错误
  3. 检查是否可以识别GPU(是)
  4. CUDA_VISIBLE_DEVICES更改为00,1
  5. 卸载tensorflow和protobuf(this answer

有人可以帮忙吗?

0 个答案:

没有答案