使用下面的segnet實作代碼
https://github.com/tkuanlun350/Tensorflow-SegNet
在main中已經修改了camvid資料集里面三個txt檔案的資料路徑,但是報錯
The model is set to Training
Max training Iteration: 20000
Initial lr: 0.001000
CamVid Image dir: /home/jiang/lane/SegNet/CamVid/train.txt
CamVid Val dir: /home/jiang/lane/SegNet/CamVid/val.txt
Batch Size: 1
Log dir: /tmp3/first350/TensorFlow/Logs
Filling queue with 146 CamVid images before starting to train. This will take a few minutes.
Filling queue with 146 CamVid images before starting to train. This will take a few minutes.
2017-11-06 23:39:54.802996: I tensorflow/core/platform/cpu_feature_guard.cc:137] Your CPU supports instructions that this TensorFlow binary was not compiled to use: SSE4.1 SSE4.2 AVX AVX2 FMA
Traceback (most recent call last):
File "/home/jiang/lane/Tensorflow-SegNet-master/main.py", line 52, in <module>
tf.app.run()
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/platform/app.py", line 48, in run
_sys.exit(main(_sys.argv[:1] + flags_passthrough))
File "/home/jiang/lane/Tensorflow-SegNet-master/main.py", line 49, in main
model.training(FLAGS, is_finetune=False)
File "/home/jiang/lane/Tensorflow-SegNet-master/model.py", line 389, in training
sess.run(init)
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/client/session.py", line 889, in run
run_metadata_ptr)
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/client/session.py", line 1120, in _run
feed_dict_tensor, options, run_metadata)
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/client/session.py", line 1317, in _do_run
options, run_metadata)
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/client/session.py", line 1336, in _do_call
raise type(e)(node_def, op, message)
tensorflow.python.framework.errors_impl.InvalidArgumentError: No OpKernel was registered to support Op 'MaxPoolWithArgmax' with these attrs. Registered devices: [CPU], Registered kernels:
<no registered kernels>
[[Node: pool1 = MaxPoolWithArgmax[T=DT_FLOAT, Targmax=DT_INT64, ksize=[1, 2, 2, 1], padding="SAME", strides=[1, 2, 2, 1]](conv1/Relu)]]
Caused by op u'pool1', defined at:
File "/home/jiang/lane/Tensorflow-SegNet-master/main.py", line 52, in <module>
tf.app.run()
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/platform/app.py", line 48, in run
_sys.exit(main(_sys.argv[:1] + flags_passthrough))
File "/home/jiang/lane/Tensorflow-SegNet-master/main.py", line 49, in main
model.training(FLAGS, is_finetune=False)
File "/home/jiang/lane/Tensorflow-SegNet-master/model.py", line 372, in training
loss, eval_prediction = inference(train_data_node, train_labels_node, batch_size, phase_train)
File "/home/jiang/lane/Tensorflow-SegNet-master/model.py", line 182, in inference
padding='SAME', name='pool1')
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/ops/gen_nn_ops.py", line 3525, in max_pool_with_argmax
padding=padding, Targmax=Targmax, name=name)
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/framework/op_def_library.py", line 787, in _apply_op_helper
op_def=op_def)
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/framework/ops.py", line 2956, in create_op
op_def=op_def)
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/framework/ops.py", line 1470, in __init__
self._traceback = self._graph._extract_stack() # pylint: disable=protected-access
InvalidArgumentError (see above for traceback): No OpKernel was registered to support Op 'MaxPoolWithArgmax' with these attrs. Registered devices: [CPU], Registered kernels:
<no registered kernels>
[[Node: pool1 = MaxPoolWithArgmax[T=DT_FLOAT, Targmax=DT_INT64, ksize=[1, 2, 2, 1], padding="SAME", strides=[1, 2, 2, 1]](conv1/Relu)]]
不知道怎么回事 查半天也沒查出來
uj5u.com熱心網友回復:
求大神指導啊uj5u.com熱心網友回復:
uj5u.com熱心網友回復:
MaxPoolWithArgmax這個使用theano實作的 我不知道你這版tf實作的是什么情況,我用keras,后臺使用theano調的成功了 但是效果不太行,可以討論下uj5u.com熱心網友回復:
你現在會了嗎?。。uj5u.com熱心網友回復:
之前幾天一直在解決這個問題:新建一個環境,python=3.6 安裝tensorflow版本指定為1.11。
注意Util.py檔案的cpu還是gpu
uj5u.com熱心網友回復:
runfile('C:/Users/dell/Desktop/Tensorflow-SegNet-master/main.py', wdir='C:/Users/dell/Desktop/Tensorflow-SegNet-master')The model is set to Training
Max training Iteration: 20000
Initial lr: 0.001000
CamVid Image dir: C:/Users/dell/Desktop/Tensorflow-SegNet-master/CamVid/train.txt
CamVid Val dir: C:/Users/dell/Desktop/Tensorflow-SegNet-master/CamVid/val.txt
Batch Size: 5
Log dir: C:/Users/dell/Desktop/Tensorflow-SegNet-master/CamVid/Logs
WARNING:tensorflow:From C:\anaconda3\envs\tensorflow\lib\site-packages\tensorflow\python\framework\op_def_library.py:263: colocate_with (from tensorflow.python.framework.ops) is deprecated and will be removed in a future version.
Instructions for updating:
Colocations handled automatically by placer.
WARNING:tensorflow:From C:\Users\dell\Desktop\Tensorflow-SegNet-master\Inputs.py:107: slice_input_producer (from tensorflow.python.training.input) is deprecated and will be removed in a future version.
Instructions for updating:
Queue-based input pipelines have been replaced by `tf.data`. Use `tf.data.Dataset.from_tensor_slices(tuple(tensor_list)).shuffle(tf.shape(input_tensor, out_type=tf.int64)[0]).repeat(num_epochs)`. If `shuffle=False`, omit the `.shuffle(...)`.
WARNING:tensorflow:From C:\anaconda3\envs\tensorflow\lib\site-packages\tensorflow\python\training\input.py:374: range_input_producer (from tensorflow.python.training.input) is deprecated and will be removed in a future version.
Instructions for updating:
Queue-based input pipelines have been replaced by `tf.data`. Use `tf.data.Dataset.range(limit).shuffle(limit).repeat(num_epochs)`. If `shuffle=False`, omit the `.shuffle(...)`.
WARNING:tensorflow:From C:\anaconda3\envs\tensorflow\lib\site-packages\tensorflow\python\training\input.py:320: input_producer (from tensorflow.python.training.input) is deprecated and will be removed in a future version.
Instructions for updating:
Queue-based input pipelines have been replaced by `tf.data`. Use `tf.data.Dataset.from_tensor_slices(input_tensor).shuffle(tf.shape(input_tensor, out_type=tf.int64)[0]).repeat(num_epochs)`. If `shuffle=False`, omit the `.shuffle(...)`.
WARNING:tensorflow:From C:\anaconda3\envs\tensorflow\lib\site-packages\tensorflow\python\training\input.py:190: limit_epochs (from tensorflow.python.training.input) is deprecated and will be removed in a future version.
Instructions for updating:
Queue-based input pipelines have been replaced by `tf.data`. Use `tf.data.Dataset.from_tensors(tensor).repeat(num_epochs)`.
WARNING:tensorflow:From C:\anaconda3\envs\tensorflow\lib\site-packages\tensorflow\python\training\input.py:199: QueueRunner.__init__ (from tensorflow.python.training.queue_runner_impl) is deprecated and will be removed in a future version.
Instructions for updating:
To construct input pipelines, use the `tf.data` module.
WARNING:tensorflow:From C:\anaconda3\envs\tensorflow\lib\site-packages\tensorflow\python\training\input.py:199: add_queue_runner (from tensorflow.python.training.queue_runner_impl) is deprecated and will be removed in a future version.
Instructions for updating:
To construct input pipelines, use the `tf.data` module.
WARNING:tensorflow:From C:\anaconda3\envs\tensorflow\lib\site-packages\tensorflow\python\training\input.py:202: to_float (from tensorflow.python.ops.math_ops) is deprecated and will be removed in a future version.
Instructions for updating:
Use tf.cast instead.
Filling queue with 146 CamVid images before starting to train. This will take a few minutes.
WARNING:tensorflow:From C:\Users\dell\Desktop\Tensorflow-SegNet-master\Inputs.py:44: shuffle_batch (from tensorflow.python.training.input) is deprecated and will be removed in a future version.
Instructions for updating:
Queue-based input pipelines have been replaced by `tf.data`. Use `tf.data.Dataset.shuffle(min_after_dequeue).batch(batch_size)`.
Filling queue with 146 CamVid images before starting to train. This will take a few minutes.
WARNING: The TensorFlow contrib module will not be included in TensorFlow 2.0.
For more information, please see:
* https://github.com/tensorflow/community/blob/master/rfcs/20180907-contrib-sunset.md
* https://github.com/tensorflow/addons
If you depend on functionality not listed there, please file an issue.
INFO:tensorflow:Summary name conv_classifier/weight_loss (raw) is illegal; using conv_classifier/weight_loss__raw_ instead.
INFO:tensorflow:Summary name loss/cross_entropy (raw) is illegal; using loss/cross_entropy__raw_ instead.
INFO:tensorflow:Summary name loss/total_loss (raw) is illegal; using loss/total_loss__raw_ instead.
WARNING:tensorflow:From C:\anaconda3\envs\tensorflow\lib\site-packages\tensorflow\python\ops\math_ops.py:3066: to_int32 (from tensorflow.python.ops.math_ops) is deprecated and will be removed in a future version.
Instructions for updating:
Use tf.cast instead.
WARNING:tensorflow:From C:\Users\dell\Desktop\Tensorflow-SegNet-master\model.py:393: start_queue_runners (from tensorflow.python.training.queue_runner_impl) is deprecated and will be removed in a future version.
Instructions for updating:
To construct input pipelines, use the `tf.data` module.
uj5u.com熱心網友回復:
Instructions for updating: Colocations handled automatically by placer.想問一下 這個問題怎么解決~
轉載請註明出處,本文鏈接:https://www.uj5u.com/qita/124971.html
上一篇:微盟程式員刪庫跑路,被判刑六年!
下一篇:JUC并發系列(四):【面試常問】多種方法解決ArrayList非執行緒安全,詳解CopyOnWriteArrayList(代碼示例)
