LucasSheng / avatar-net

Avatar-Net: Multi-scale Zero-shot Style Transfer by Feature Decoration
https://lucassheng.github.io/avatar-net/
178 stars 38 forks source link

help, run evaluate_style_transfer.sh fail #3

Closed zhyx closed 6 years ago

zhyx commented 6 years ago

I have downloaded the trained model of Avatar-Net. then run evaluate_style_transfer.sh, but fail. My tensorflow version is 1.8. error log: /root/anaconda3/envs/tf17_py36/lib/python3.6/site-packages/h5py/init.py:34: FutureWarning: Conversion of the second argument of issubdtype from float to np.floating is deprecated. In future, it will be treated as np.float64 == np.dtype(float).type. from ._conv import register_converters as _register_converters Finish loading the model [AvatarNet] configuration Traceback (most recent call last): File "evaluate_style_transfer.py", line 163, in tf.app.run() File "/root/anaconda3/envs/tf17_py36/lib/python3.6/site-packages/tensorflow/python/platform/app.py", line 48, in run _sys.exit(main(_sys.argv[:1] + flags_passthrough)) File "evaluate_style_transfer.py", line 112, in main inter_weight=FLAGS.inter_weight) File "/ai/zhyx/docker/avatar-net-master/models/avatar_net.py", line 94, in transfer_styles style, self.network_name) File "/ai/zhyx/docker/avatar-net-master/models/losses.py", line 85, in extract_image_features inputs, spatial_squeeze=False, is_training=False, reuse=reuse) File "/ai/zhyx/docker/avatar-net-master/models/vgg.py", line 226, in vgg_19 net = slim.repeat(inputs, 2, slim.conv2d, 64, [3, 3], scope='conv1') File "/root/anaconda3/envs/tf17_py36/lib/python3.6/site-packages/tensorflow/contrib/layers/python/layers/layers.py", line 2060, in repeat outputs = layer(outputs, *args, kwargs) File "/root/anaconda3/envs/tf17_py36/lib/python3.6/site-packages/tensorflow/contrib/framework/python/ops/arg_scope.py", line 181, in func_with_args return func(*args, *current_args) File "/root/anaconda3/envs/tf17_py36/lib/python3.6/site-packages/tensorflow/contrib/layers/python/layers/layers.py", line 1027, in convolution outputs = layer.apply(inputs) File "/root/anaconda3/envs/tf17_py36/lib/python3.6/site-packages/tensorflow/python/layers/base.py", line 503, in apply return self.call(inputs, args, kwargs) File "/root/anaconda3/envs/tf17_py36/lib/python3.6/site-packages/tensorflow/python/layers/base.py", line 443, in call self.build(input_shapes[0]) File "/root/anaconda3/envs/tf17_py36/lib/python3.6/site-packages/tensorflow/python/layers/convolutional.py", line 137, in build dtype=self.dtype) File "/root/anaconda3/envs/tf17_py36/lib/python3.6/site-packages/tensorflow/python/layers/base.py", line 383, in add_variable trainable=trainable and self.trainable) File "/root/anaconda3/envs/tf17_py36/lib/python3.6/site-packages/tensorflow/python/ops/variable_scope.py", line 1065, in get_variable use_resource=use_resource, custom_getter=custom_getter) File "/root/anaconda3/envs/tf17_py36/lib/python3.6/site-packages/tensorflow/python/ops/variable_scope.py", line 962, in get_variable use_resource=use_resource, custom_getter=custom_getter) File "/root/anaconda3/envs/tf17_py36/lib/python3.6/site-packages/tensorflow/python/ops/variable_scope.py", line 360, in get_variable validate_shape=validate_shape, use_resource=use_resource) File "/root/anaconda3/envs/tf17_py36/lib/python3.6/site-packages/tensorflow/contrib/layers/python/layers/layers.py", line 1561, in layer_variable_getter return _model_variable_getter(getter, *args, kwargs) File "/root/anaconda3/envs/tf17_py36/lib/python3.6/site-packages/tensorflow/contrib/layers/python/layers/layers.py", line 1553, in _model_variable_getter custom_getter=getter, use_resource=use_resource) File "/root/anaconda3/envs/tf17_py36/lib/python3.6/site-packages/tensorflow/contrib/framework/python/ops/arg_scope.py", line 181, in func_with_args return func(*args, *current_args) File "/root/anaconda3/envs/tf17_py36/lib/python3.6/site-packages/tensorflow/contrib/framework/python/ops/variables.py", line 261, in model_variable use_resource=use_resource) File "/root/anaconda3/envs/tf17_py36/lib/python3.6/site-packages/tensorflow/contrib/framework/python/ops/arg_scope.py", line 181, in func_with_args return func(args, current_args) File "/root/anaconda3/envs/tf17_py36/lib/python3.6/site-packages/tensorflow/contrib/framework/python/ops/variables.py", line 216, in variable use_resource=use_resource) File "/root/anaconda3/envs/tf17_py36/lib/python3.6/site-packages/tensorflow/python/ops/variable_scope.py", line 352, in _true_getter use_resource=use_resource) File "/root/anaconda3/envs/tf17_py36/lib/python3.6/site-packages/tensorflow/python/ops/variable_scope.py", line 682, in _get_single_variable "VarScope?" % name) ValueError: Variable vgg_19/conv1/conv1_1/weights does not exist, or was not created with tf.get_variable(). Did you mean to set reuse=None in VarScope?

LucasSheng commented 6 years ago

I think this is because of incompatibility with the used TF. I did not update the codes for the newest version of Tensorflow (e.g. TF 1.8).

I think you can check the other issues for VGG-19 weights loading problem.