lengstrom / fast-style-transfer

TensorFlow CNN for fast style transfer ⚡🖥🎨🖼
10.91k stars 2.6k forks source link

AttributeError: 'int' object has no attribute 'value' #278

Closed Stepend closed 2 years ago

Stepend commented 2 years ago

(tf-gpu) xxxx@xxx:~/DF/Model/fast-style-transfer$ python style.py --style ShuiMo.jpg --checkpoint-dir checkpoint/ --test img/Stepend.jpg --test-dir output / --content-weight 1.5e1 --checkpoint-iterations 1000 --batch-size 20 Train set has been trimmed slightly.. (1, 713, 760, 3) 2021-11-24 03:41:33.966660: I tensorflow/stream_executor/cuda/cuda_gpu_executor. cc:937] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero 2021-11-24 03:41:33.967335: I tensorflow/stream_executor/cuda/cuda_gpu_executor. cc:937] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero 2021-11-24 03:41:33.972016: I tensorflow/stream_executor/cuda/cuda_gpu_executor. cc:937] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero 2021-11-24 03:41:33.972693: I tensorflow/stream_executor/cuda/cuda_gpu_executor. cc:937] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero 2021-11-24 03:41:33.973324: I tensorflow/stream_executor/cuda/cuda_gpu_executor. cc:937] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero 2021-11-24 03:41:33.973942: I tensorflow/stream_executor/cuda/cuda_gpu_executor. cc:937] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero 2021-11-24 03:41:33.974772: I tensorflow/core/platform/cpu_feature_guard.cc:142] This TensorFlow binary is optimized with oneAPI Deep Neural Network Library (on eDNN) to use the following CPU instructions in performance-critical operations: AVX2 FMA To enable them in other operations, rebuild TensorFlow with the appropriate comp iler flags. 2021-11-24 03:41:34.157516: I tensorflow/stream_executor/cuda/cuda_gpu_executor. cc:937] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero 2021-11-24 03:41:34.158113: I tensorflow/stream_executor/cuda/cuda_gpu_executor. cc:937] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero 2021-11-24 03:41:34.158676: I tensorflow/stream_executor/cuda/cuda_gpu_executor. cc:937] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero 2021-11-24 03:41:34.159227: I tensorflow/stream_executor/cuda/cuda_gpu_executor. cc:937] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero 2021-11-24 03:41:34.159774: I tensorflow/stream_executor/cuda/cuda_gpu_executor. cc:937] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero 2021-11-24 03:41:34.160337: I tensorflow/stream_executor/cuda/cuda_gpu_executor. cc:937] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero 2021-11-24 03:41:34.778173: I tensorflow/stream_executor/cuda/cuda_gpu_executor. cc:937] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero 2021-11-24 03:41:34.778795: I tensorflow/stream_executor/cuda/cuda_gpu_executor. cc:937] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero 2021-11-24 03:41:34.779355: I tensorflow/stream_executor/cuda/cuda_gpu_executor. cc:937] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero 2021-11-24 03:41:34.779913: I tensorflow/stream_executor/cuda/cuda_gpu_executor. cc:937] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero 2021-11-24 03:41:34.780477: I tensorflow/stream_executor/cuda/cuda_gpu_executor. cc:937] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero 2021-11-24 03:41:34.781032: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1 510] Created device /job:localhost/replica:0/task:0/device:GPU:0 with 9659 MB me mory: -> device: 0, name: GeForce RTX 2080 Ti, pci bus id: 0000:05:00.0, comput e capability: 7.5 2021-11-24 03:41:34.781300: I tensorflow/stream_executor/cuda/cuda_gpu_executor. cc:937] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero 2021-11-24 03:41:34.781848: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1 510] Created device /job:localhost/replica:0/task:0/device:GPU:1 with 9659 MB me mory: -> device: 1, name: GeForce RTX 2080 Ti, pci bus id: 0000:06:00.0, comput e capability: 7.5 2021-11-24 03:41:36.964966: I tensorflow/stream_executor/cuda/cuda_gpu_executor. cc:937] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero 2021-11-24 03:41:36.965778: I tensorflow/stream_executor/cuda/cuda_gpu_executor. cc:937] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero 2021-11-24 03:41:36.966485: I tensorflow/stream_executor/cuda/cuda_gpu_executor. cc:937] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero 2021-11-24 03:41:36.967177: I tensorflow/stream_executor/cuda/cuda_gpu_executor. cc:937] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero 2021-11-24 03:41:36.967867: I tensorflow/stream_executor/cuda/cuda_gpu_executor. cc:937] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero 2021-11-24 03:41:36.968566: I tensorflow/stream_executor/cuda/cuda_gpu_executor. cc:937] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero 2021-11-24 03:41:36.969323: I tensorflow/stream_executor/cuda/cuda_gpu_executor. cc:937] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero 2021-11-24 03:41:36.970016: I tensorflow/stream_executor/cuda/cuda_gpu_executor. cc:937] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero 2021-11-24 03:41:36.970685: I tensorflow/stream_executor/cuda/cuda_gpu_executor. cc:937] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero 2021-11-24 03:41:36.971321: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1 510] Created device /job:localhost/replica:0/task:0/device:GPU:0 with 9659 MB me mory: -> device: 0, name: GeForce RTX 2080 Ti, pci bus id: 0000:05:00.0, comput e capability: 7.5 2021-11-24 03:41:36.971412: I tensorflow/stream_executor/cuda/cuda_gpu_executor. cc:937] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero 2021-11-24 03:41:36.972045: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1 510] Created device /job:localhost/replica:0/task:0/device:GPU:1 with 9659 MB me mory: -> device: 1, name: GeForce RTX 2080 Ti, pci bus id: 0000:06:00.0, comput e capability: 7.5 Traceback (most recent call last): File "style.py", line 168, in main() File "style.py", line 147, in main for preds, losses, i, epoch in optimize(*args, **kwargs): File "src/optimize.py", line 63, in optimize preds = transform.net(X_content/255.0) File "src/transform.py", line 6, in net conv1 = _conv_layer(image, 32, 9, 1) File "src/transform.py", line 21, in _conv_layer weights_init = _conv_init_vars(net, num_filters, filter_size) File "src/transform.py", line 60, in _conv_initvars , rows, cols, in_channels = [i.value for i in net.getshape()] File "src/transform.py", line 60, in , rows, cols, in_channels = [i.value for i in net.get_shape()] AttributeError: 'int' object has no attribute 'value'

Stepend commented 2 years ago

removing "value" can work