avatar-net
avatar-net copied to clipboard
TypeError: Expected binary or unicode string, got None
I try to run this program,but fail...
Finish loading the model [AvatarNet] configuration Traceback (most recent call last): File "evaluate_style_transfer.py", line 163, in tf.app.run() File "/usr/local/lib/python3.5/dist-packages/tensorflow/python/platform/app.py", line 44, in run _sys.exit(main(_sys.argv[:1] + flags_passthrough)) File "evaluate_style_transfer.py", line 121, in main checkpoint_dir, slim.get_model_variables(), ignore_missing_vars=True) File "/usr/local/lib/python3.5/dist-packages/tensorflow/contrib/framework/python/ops/variables.py", line 571, in assign_from_checkpoint_fn reader = pywrap_tensorflow.NewCheckpointReader(model_path) File "/usr/local/lib/python3.5/dist-packages/tensorflow/python/pywrap_tensorflow.py", line 110, in NewCheckpointReader return CheckpointReader(compat.as_bytes(filepattern), status) File "/usr/local/lib/python3.5/dist-packages/tensorflow/python/util/compat.py", line 65, in as_bytes (bytes_or_text,)) TypeError: Expected binary or unicode string, got None could you give me some suggestion?
I met this problem too, did you solve it?
I try to run this program,but fail...
Finish loading the model [AvatarNet] configuration Traceback (most recent call last): File "evaluate_style_transfer.py", line 163, in tf.app.run() File "/usr/local/lib/python3.5/dist-packages/tensorflow/python/platform/app.py", line 44, in run _sys.exit(main(_sys.argv[:1] + flags_passthrough)) File "evaluate_style_transfer.py", line 121, in main checkpoint_dir, slim.get_model_variables(), ignore_missing_vars=True) File "/usr/local/lib/python3.5/dist-packages/tensorflow/contrib/framework/python/ops/variables.py", line 571, in assign_from_checkpoint_fn reader = pywrap_tensorflow.NewCheckpointReader(model_path) File "/usr/local/lib/python3.5/dist-packages/tensorflow/python/pywrap_tensorflow.py", line 110, in NewCheckpointReader return CheckpointReader(compat.as_bytes(filepattern), status) File "/usr/local/lib/python3.5/dist-packages/tensorflow/python/util/compat.py", line 65, in as_bytes (bytes_or_text,)) TypeError: Expected binary or unicode string, got None could you give me some suggestion?
see here https://github.com/LucasSheng/avatar-net/issues/1 what we need to do is to specify a ckpt name instead of a ckpt dir to checkpoint_dir
I met the same problem. Have you solved it @freefly-huanshao @Parker-Lyu ?
I met the same problem. Have you solved it @freefly-huanshao @Parker-Lyu ?
what i did is to specify a ckpt name instead of a ckpt dir to checkpoint_dir. That works to me. Good luck
Sorry I'm new in tensorflow. There are 3 files .data, .index and .meta, how could you specify the ckpt @Parker-Lyu ?
Sorry I'm new in tensorflow. There are 3 files .data, .index and .meta, how could you specify the ckpt @Parker-Lyu ?
Sorry for the stupid question. Problem solved!
Hi guys, I'm trying to resolve this issue as well. I have created a checkpoint.txt file and put this into that file: model_checkpoint_path: "C:\avatar-net-master\data\AvatarNet\model.ckpt-120000.data-00000-of-00001"
now when I run I get this error....could you expand @LucasSheng on how paths should be defined etc?
(TFGPU) C:\avatar-net-master>python evaluate_style_transfer.py --content_dataset_dir C:\avatar-net-master\data\contents\images --style_dataset_dir C:\avatar-net-master\data\contents\images --checkpoint_dir C:\avatar-net-master\data\AvatarNet\model.ckpt-120000.data-00000-of-00001
C:\ProgramData\Anaconda3\lib\site-packages\h5py_init_.py:36: 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
Traceback (most recent call last):
File "evaluate_style_transfer.py", line 163, in
Thanks heaps
@CJHFUTURE Here is how I resolved this problem. Perhaps it's just a style of tensorflow framework to load checkpoint. Please directly give the directory.
init_fn = slim.assign_from_checkpoint_fn("/path/to/cvpr-18_avatar-net/data/model.ckpt-120000", slim.get_model_variables(), ignore_missing_vars=True)
with tf.Session() as sess:
init_fn(sess)
nn = 0.0
total_time = 0.0