Open shz0519 opened 7 years ago
因为tensorflow version > r0.12
, tf.split
的参数位置换了,打开vgg_preprocessing.py, 将tf.split(2, num_channels, image)
修改为tf.split(image, num_channels, 2)
python eval.py --model_file model/wave.ckpt-done --image_file img/test.jpg 执行报错 !y
Caused by op 'save/RestoreV2_15', defined at:
File "eval.py", line 77, in
InvalidArgumentError (see above for traceback): Unsuccessful TensorSliceReader constructor: Failed to get matching files on /home/thomas/fast-neural-style-tensorflow/model/wave.ckpt-done: Not found: /home/thomas/fast-neural-style-tensorflow/model [[Node: save/RestoreV2_15 = RestoreV2[dtypes=[DT_FLOAT], _device="/job:localhost/replica:0/task:0/cpu:0"](_recv_save/Const_0, save/RestoreV2_15/tensor_names, save/RestoreV2_15/shape_and_slices)]] [[Node: save/RestoreV2_15/_7 = _Recv[client_terminated=false, recv_device="/job:localhost/replica:0/task:0/gpu:0", send_device="/job:localhost/replica:0/task:0/cpu:0", send_device_incarnation=1, tensor_name="edge_56_save/RestoreV2_15", tensor_type=DT_FLOAT, _device="/job:localhost/replica:0/task:0/gpu:0"]()]]
您好!我执行时报如下错误,这是什么原因导致的呢?求教 Traceback (most recent call last): File "eval.py", line 62, in
tf.app.run()
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/platform/app.py", line 44, in run
_sys.exit(main(_sys.argv[:1] + flags_passthrough))
File "eval.py", line 38, in main
image = reader.get_image(FLAGS.image_file, height, width, image_preprocessing_fn)
File "/home/minist/deep_learning/style transfer code/hzy46 fast-neural-style-tensorflow/fast-neural-style-tensorflow-master/reader.py", line 10, in get_image
return preprocess_fn(image, height, width)
File "/home/minist/deep_learning/style transfer code/hzy46 fast-neural-style-tensorflow/fast-neural-style-tensorflow-master/preprocessing/preprocessing_factory.py", line 70, in preprocessing_fn
image, output_height, output_width, is_training=is_training, **kwargs)
File "/home/minist/deep_learning/style transfer code/hzy46 fast-neural-style-tensorflow/fast-neural-style-tensorflow-master/preprocessing/vgg_preprocessing.py", line 388, in preprocess_image
resize_side_min)
File "/home/minist/deep_learning/style transfer code/hzy46 fast-neural-style-tensorflow/fast-neural-style-tensorflow-master/preprocessing/vgg_preprocessing.py", line 357, in preprocess_for_eval
return _mean_image_subtraction(image, [_R_MEAN, _G_MEAN, _B_MEAN])
File "/home/minist/deep_learning/style transfer code/hzy46 fast-neural-style-tensorflow/fast-neural-style-tensorflow-master/preprocessing/vgg_preprocessing.py", line 231, in _mean_image_subtraction
channels = tf.split(2, num_channels, image)
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/ops/array_ops.py", line 1319, in split
split_dim=axis, num_split=num_or_size_splits, value=value, name=name)
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/ops/gen_array_ops.py", line 3385, in _split
num_split=num_split, name=name)
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/framework/op_def_library.py", line 509, in apply_op
(prefix, dtypes.as_dtype(input_arg.type).name))
TypeError: Input 'split_dim' of 'Split' Op has type float32 that does not match expected type of int32.