can't run inference.py
See original GitHub issueHello!
First thanks a lot for your code base! I am trying to run the inference.py without running the training. I downloaded the pre-trained model, and set up the data folders following your instructions. I ran into this error:
/usr/local/lib/python2.7/dist-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
WARNING:tensorflow:From /usr/local/lib/python2.7/dist-packages/tensorflow/contrib/learn/python/learn/datasets/base.py:198: retry (from tensorflow.contrib.learn.python.learn.datasets.base) is deprecated and will be removed in a future version.
Instructions for updating:
Use the retry module or similar alternatives.
INFO:tensorflow:Using default config.
INFO:tensorflow:Using config: {‘_save_checkpoints_secs’: 600, ‘_session_config’: None, ‘_keep_checkpoint_max’: 5, ‘_task_type’: ‘worker’, ‘_global_id_in_cluster’: 0, ‘_is_chief’: True, ‘_cluster_spec’: <tensorflow.python.training.server_lib.ClusterSpec object at 0x7f4755d708d0>, ‘_evaluation_master’: ‘’, ‘_save_checkpoints_steps’: None, ‘_keep_checkpoint_every_n_hours’: 10000, ‘_service’: None, ‘_num_ps_replicas’: 0, ‘_tf_random_seed’: None, ‘_master’: ‘’, ‘_num_worker_replicas’: 1, ‘_task_id’: 0, ‘_log_step_count_steps’: 100, ‘_model_dir’: ‘./model’, ‘_save_summary_steps’: 100}
[‘dataset/hisi_images/hisi_000001.jpg’]
yannuo debug
<generator object predict at 0x7f4756090370>
INFO:tensorflow:Calling model_fn.
INFO:tensorflow:Done calling model_fn.
INFO:tensorflow:Graph was finalized.
2018-04-27 16:34:02.949711: I tensorflow/core/platform/cpu_feature_guard.cc:140] Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX2 FMA
INFO:tensorflow:Restoring parameters from ./model/model.ckpt-30358
INFO:tensorflow:Running local_init_op.
INFO:tensorflow:Done running local_init_op.
2018-04-27 16:34:05.296762: W tensorflow/core/framework/op_kernel.cc:1273] OP_REQUIRES failed at iterator_ops.cc:891 : Invalid argument: Number of ways to split should evenly divide the split dimension, but got split_dim 2 (size = 4) and num_split 3
[[Node: split = Split[T=DT_FLOAT, num_split=3](split/split_dim, ToFloat)]]
Traceback (most recent call last):
File “inference_save.py”, line 104, in <module>
tf.app.run(main=main, argv=[sys.argv[0]] + unparsed)
File “/usr/local/lib/python2.7/dist-packages/tensorflow/python/platform/app.py”, line 126, in run
_sys.exit(main(argv))
File “inference_save.py”, line 85, in main
for pred_dict, image_path in zip(predictions, image_files):
File “/usr/local/lib/python2.7/dist-packages/tensorflow/python/estimator/estimator.py”, line 501, in predict
preds_evaluated = mon_sess.run(predictions)
File “/usr/local/lib/python2.7/dist-packages/tensorflow/python/training/monitored_session.py”, line 546, in run
run_metadata=run_metadata)
File “/usr/local/lib/python2.7/dist-packages/tensorflow/python/training/monitored_session.py”, line 1022, in run
run_metadata=run_metadata)
File “/usr/local/lib/python2.7/dist-packages/tensorflow/python/training/monitored_session.py”, line 1113, in run
raise six.reraise(*original_exc_info)
File “/usr/local/lib/python2.7/dist-packages/tensorflow/python/training/monitored_session.py”, line 1098, in run
return self._sess.run(*args, **kwargs)
File “/usr/local/lib/python2.7/dist-packages/tensorflow/python/training/monitored_session.py”, line 1170, in run
run_metadata=run_metadata)
File “/usr/local/lib/python2.7/dist-packages/tensorflow/python/training/monitored_session.py”, line 950, in run
return self._sess.run(*args, **kwargs)
File “/usr/local/lib/python2.7/dist-packages/tensorflow/python/client/session.py”, line 905, in run
run_metadata_ptr)
File “/usr/local/lib/python2.7/dist-packages/tensorflow/python/client/session.py”, line 1140, in _run
feed_dict_tensor, options, run_metadata)
File “/usr/local/lib/python2.7/dist-packages/tensorflow/python/client/session.py”, line 1321, in _do_run
run_metadata)
File “/usr/local/lib/python2.7/dist-packages/tensorflow/python/client/session.py”, line 1340, in _do_call
raise type(e)(node_def, op, message)
tensorflow.python.framework.errors_impl.InvalidArgumentError: Number of ways to split should evenly divide the split dimension, but got split_dim 2 (size = 4) and num_split 3
[[Node: split = Split[T=DT_FLOAT, num_split=3](split/split_dim, ToFloat)]]
[[Node: IteratorGetNext = IteratorGetNextoutput_shapes=[[?,?,?,3]], output_types=[DT_FLOAT], _device=“/job:localhost/replica:0/task:0/device:CPU:0”]]
============================== I couldn’t figure out what went wrong, really appreciate the help.
Thanks !! Yannuo
Issue Analytics
- State:
- Created 5 years ago
- Comments:7 (1 by maintainers)
Top GitHub Comments
I have similar issue with Python 3.5, Tensorflow 1.12, CUDA 8
tensorflow.python.framework.errors_impl.InvalidArgumentError: Number of ways to split should evenly divide the split dimension, but got split_dim 2 (size = 1) and num_split 3 [[{{node split}} = Split[T=DT_FLOAT, num_split=3, _device=“/device:CPU:0”](split/split_dim, ToFloat)]] [[{{node IteratorGetNext}} = IteratorGetNextoutput_shapes=[[?,?,?,3]], output_types=[DT_FLOAT], _device=“/job:localhost/replica:0/task:0/device:CPU:0”]]
My input PNG is RGBA mode.I have finish this bug when I convert PNG to JEPG.