我只想在Tensorflow GPU上使用Deep Style Transfer,我不理解此错误

时间:2019-03-04 22:27:43

标签: python tensorflow deep-learning anaconda

好,所以我试图从Windows运行深度样式转换,以便我可以处理图像序列以创建视频。按照此this,我成功设法使guide的CPU版本正常工作 我现在已经花了很多天了,并且我尝试了很多方法来使它起作用,我创建了一个先前的问题,其中包含许多未解决的问题以及我尝试了什么 here

我现在离它最接近,可以在GPU上运行了,我不知道这个错误。

我现在正在使用anaconda 2.7版,但是在运行虚拟环境中

python 3.5.6 我手动安装

cuda 8 
cuDNN 5.1

但是我通过conda install tensorflow-gpu安装tensorflow 并运行conda list可以得到此结果

    # packages in environment at C:\Users\kurti\Anaconda2\envs\tf1:
#
# Name                    Version                   Build  Channel
_tflow_select             2.1.0                       gpu
absl-py                   0.4.1                    py35_0
astor                     0.7.1                    py35_0
blas                      1.0                         mkl
certifi                   2018.8.24                py35_1
cudatoolkit               9.0                           1
cudnn                     7.3.1                 cuda9.0_0
gast                      0.2.0                    py35_0
grpcio                    1.12.1           py35h1a1b453_0
icc_rt                    2019.0.0             h0cc432a_1
intel-openmp              2019.1                      144
libprotobuf               3.6.0                h1a1b453_0
markdown                  2.6.11                   py35_0
mkl                       2018.0.3                      1
mkl_fft                   1.0.6            py35hdbbee80_0
mkl_random                1.0.1            py35h77b88f5_1
numpy                     1.15.2           py35ha559c80_0
numpy-base                1.15.2           py35h8128ebf_0
pip                       10.0.1                   py35_0
protobuf                  3.6.0            py35he025d50_0
python                    3.5.6                he025d50_0
setuptools                40.2.0                   py35_0
six                       1.11.0                   py35_1
tensorboard               1.10.0           py35he025d50_0
tensorflow                1.10.0          gpu_py35ha5d5ef7_0
tensorflow-base           1.10.0          gpu_py35h6e53903_0
tensorflow-gpu            1.10.0               hf154084_0
termcolor                 1.1.0                    py35_1
vc                        14.1                 h0510ff6_4
vs2015_runtime            14.15.26706          h3a45250_0
werkzeug                  0.14.1                   py35_0
wheel                     0.31.1                   py35_0
wincertstore              0.2              py35hfebbdb8_0
zlib                      1.2.11               h62dcd97_3

这是我尝试运行脚本时收到的错误

    (tf1) C:\Users\kurti\GitProjects\DeepStyle>cd C:\Users\kurti\GitProjects\DeepStyle\Deep Style\neural-style-tf-master

(tf1) C:\Users\kurti\GitProjects\DeepStyle\Deep Style\neural-style-tf-master>neural_style.py --content_img littleme.jpg --style_imgs starry-night.jpg --max_iterations 100 --verbose
I c:\tf_jenkins\home\workspace\release-win\device\gpu\os\windows\tensorflow\stream_executor\dso_loader.cc:128] successfully opened CUDA library cublas64_80.dll locally
I c:\tf_jenkins\home\workspace\release-win\device\gpu\os\windows\tensorflow\stream_executor\dso_loader.cc:128] successfully opened CUDA library cudnn64_5.dll locally
I c:\tf_jenkins\home\workspace\release-win\device\gpu\os\windows\tensorflow\stream_executor\dso_loader.cc:128] successfully opened CUDA library cufft64_80.dll locally
I c:\tf_jenkins\home\workspace\release-win\device\gpu\os\windows\tensorflow\stream_executor\dso_loader.cc:128] successfully opened CUDA library nvcuda.dll locally
I c:\tf_jenkins\home\workspace\release-win\device\gpu\os\windows\tensorflow\stream_executor\dso_loader.cc:128] successfully opened CUDA library curand64_80.dll locally

---- RENDERING SINGLE IMAGE ----

I c:\tf_jenkins\home\workspace\release-win\device\gpu\os\windows\tensorflow\core\common_runtime\gpu\gpu_device.cc:885] Found device 0 with properties:
name: GeForce GTX 1080
major: 6 minor: 1 memoryClockRate (GHz) 1.835
pciBusID 0000:02:00.0
Total memory: 8.00GiB
Free memory: 6.61GiB
I c:\tf_jenkins\home\workspace\release-win\device\gpu\os\windows\tensorflow\core\common_runtime\gpu\gpu_device.cc:906] DMA: 0
I c:\tf_jenkins\home\workspace\release-win\device\gpu\os\windows\tensorflow\core\common_runtime\gpu\gpu_device.cc:916] 0:   Y
I c:\tf_jenkins\home\workspace\release-win\device\gpu\os\windows\tensorflow\core\common_runtime\gpu\gpu_device.cc:975] Creating TensorFlow device (/gpu:0) -> (device: 0, name: GeForce GTX 1080, pci bus id: 0000:02:00.0)
E c:\tf_jenkins\home\workspace\release-win\device\gpu\os\windows\tensorflow\core\common_runtime\gpu\gpu_device.cc:586] Could not identify NUMA node of /job:localhost/replica:0/task:0/gpu:0, defaulting to 0.  Your kernel may not have been built with NUMA support.

BUILDING VGG-19 NETWORK
loading model weights...
constructing layers...
LAYER GROUP 1
--conv1_1 | shape=(1, 512, 434, 64) | weights_shape=(3, 3, 3, 64)
--relu1_1 | shape=(1, 512, 434, 64) | bias_shape=(64,)
--conv1_2 | shape=(1, 512, 434, 64) | weights_shape=(3, 3, 64, 64)
--relu1_2 | shape=(1, 512, 434, 64) | bias_shape=(64,)
--pool1   | shape=(1, 256, 217, 64)
LAYER GROUP 2
--conv2_1 | shape=(1, 256, 217, 128) | weights_shape=(3, 3, 64, 128)
--relu2_1 | shape=(1, 256, 217, 128) | bias_shape=(128,)
--conv2_2 | shape=(1, 256, 217, 128) | weights_shape=(3, 3, 128, 128)
--relu2_2 | shape=(1, 256, 217, 128) | bias_shape=(128,)
--pool2   | shape=(1, 128, 109, 128)
LAYER GROUP 3
--conv3_1 | shape=(1, 128, 109, 256) | weights_shape=(3, 3, 128, 256)
--relu3_1 | shape=(1, 128, 109, 256) | bias_shape=(256,)
--conv3_2 | shape=(1, 128, 109, 256) | weights_shape=(3, 3, 256, 256)
--relu3_2 | shape=(1, 128, 109, 256) | bias_shape=(256,)
--conv3_3 | shape=(1, 128, 109, 256) | weights_shape=(3, 3, 256, 256)
--relu3_3 | shape=(1, 128, 109, 256) | bias_shape=(256,)
--conv3_4 | shape=(1, 128, 109, 256) | weights_shape=(3, 3, 256, 256)
--relu3_4 | shape=(1, 128, 109, 256) | bias_shape=(256,)
--pool3   | shape=(1, 64, 55, 256)
LAYER GROUP 4
--conv4_1 | shape=(1, 64, 55, 512) | weights_shape=(3, 3, 256, 512)
--relu4_1 | shape=(1, 64, 55, 512) | bias_shape=(512,)
--conv4_2 | shape=(1, 64, 55, 512) | weights_shape=(3, 3, 512, 512)
--relu4_2 | shape=(1, 64, 55, 512) | bias_shape=(512,)
--conv4_3 | shape=(1, 64, 55, 512) | weights_shape=(3, 3, 512, 512)
--relu4_3 | shape=(1, 64, 55, 512) | bias_shape=(512,)
--conv4_4 | shape=(1, 64, 55, 512) | weights_shape=(3, 3, 512, 512)
--relu4_4 | shape=(1, 64, 55, 512) | bias_shape=(512,)
--pool4   | shape=(1, 32, 28, 512)
LAYER GROUP 5
--conv5_1 | shape=(1, 32, 28, 512) | weights_shape=(3, 3, 512, 512)
--relu5_1 | shape=(1, 32, 28, 512) | bias_shape=(512,)
--conv5_2 | shape=(1, 32, 28, 512) | weights_shape=(3, 3, 512, 512)
--relu5_2 | shape=(1, 32, 28, 512) | bias_shape=(512,)
--conv5_3 | shape=(1, 32, 28, 512) | weights_shape=(3, 3, 512, 512)
--relu5_3 | shape=(1, 32, 28, 512) | bias_shape=(512,)
--conv5_4 | shape=(1, 32, 28, 512) | weights_shape=(3, 3, 512, 512)
--relu5_4 | shape=(1, 32, 28, 512) | bias_shape=(512,)
--pool5   | shape=(1, 16, 14, 512)
Traceback (most recent call last):
  File "C:\Users\kurti\GitProjects\DeepStyle\Deep Style\neural-style-tf-master\neural_style.py", line 858, in <module>
    main()
  File "C:\Users\kurti\GitProjects\DeepStyle\Deep Style\neural-style-tf-master\neural_style.py", line 855, in main
    else: render_single_image()
  File "C:\Users\kurti\GitProjects\DeepStyle\Deep Style\neural-style-tf-master\neural_style.py", line 824, in render_single_image
    stylize(content_img, style_imgs, init_img)
  File "C:\Users\kurti\GitProjects\DeepStyle\Deep Style\neural-style-tf-master\neural_style.py", line 564, in stylize
    L_tv = tf.image.total_variation(net['input'])
AttributeError: module 'tensorflow.python.ops.image_ops' has no attribute 'total_variation'

初始指南还需要其他3个依赖项,我已经通过在激活的环境中使用pip3命令安装了这些依赖项,但是我不确定Cuda是否正在使用这些依赖项,这可能会导致错误?如果是这样,我如何告诉cuda安装那些.whl的

请帮助,我不知道该怎么办。

0 个答案:

没有答案