balancap / SSD-Tensorflow

Single Shot MultiBox Detector in TensorFlow
4.11k stars 1.89k forks source link

how to train on CPU? #268

Open ghost opened 6 years ago

ghost commented 6 years ago

INFO:tensorflow:Fine-tuning from /home/sunkunyang/PycharmProjects/SSD-Tensorflow-master/checkpoints/vgg_16.ckpt. Ignoring missing vars: False 2018-07-29 16:38:21.445952: 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 INFO:tensorflow:Restoring parameters from /home/sunkunyang/PycharmProjects/SSD-Tensorflow-master/checkpoints/vgg_16.ckpt INFO:tensorflow:Starting Session. INFO:tensorflow:Saving checkpoint to path /home/sunkunyang/PycharmProjects/SSD-Tensorflow-master/logs/model.ckpt INFO:tensorflow:Starting Queues. 2018-07-29 16:38:24.476202: E tensorflow/core/common_runtime/executor.cc:643] Executor failed to create kernel. Invalid argument: Default MaxPoolingOp only supports NHWC. [[Node: ssd_300_vgg/pool1/MaxPool = MaxPoolT=DT_FLOAT, data_format="NCHW", ksize=[1, 1, 2, 2], padding="SAME", strides=[1, 1, 2, 2], _device="/job:localhost/replica:0/task:0/device:CPU:0"]] INFO:tensorflow:Error reported to Coordinator: <class 'tensorflow.python.framework.errors_impl.InvalidArgumentError'>, Default MaxPoolingOp only supports NHWC. [[Node: ssd_300_vgg/pool1/MaxPool = MaxPoolT=DT_FLOAT, data_format="NCHW", ksize=[1, 1, 2, 2], padding="SAME", strides=[1, 1, 2, 2], _device="/job:localhost/replica:0/task:0/device:CPU:0"]]

Caused by op 'ssd_300_vgg/pool1/MaxPool', defined at: File "./train_ssd_network.py", line 391, in tf.app.run() File "/home/sunkunyang/anaconda3/lib/python3.6/site-packages/tensorflow/python/platform/app.py", line 48, in run _sys.exit(main(_sys.argv[:1] + flags_passthrough)) File "./train_ssd_network.py", line 292, in main clones = model_deploy.create_clones(deploy_config, clone_fn, [batch_queue]) File "/home/sunkunyang/PycharmProjects/SSD-Tensorflow-master/deployment/model_deploy.py", line 196, in create_clones outputs = model_fn(*args, kwargs) File "./train_ssd_network.py", line 276, in clone_fn ssd_net.net(b_image, is_training=True) File "/home/sunkunyang/PycharmProjects/SSD-Tensorflow-master/nets/ssd_vgg_300.py", line 155, in net scope=scope) File "/home/sunkunyang/PycharmProjects/SSD-Tensorflow-master/nets/ssd_vgg_300.py", line 454, in ssd_net net = slim.max_pool2d(net, [2, 2], scope='pool1') File "/home/sunkunyang/anaconda3/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 "/home/sunkunyang/anaconda3/lib/python3.6/site-packages/tensorflow/contrib/layers/python/layers/layers.py", line 2142, in max_pool2d outputs = layer.apply(inputs) File "/home/sunkunyang/anaconda3/lib/python3.6/site-packages/tensorflow/python/layers/base.py", line 671, in apply return self.call(inputs, args, kwargs) File "/home/sunkunyang/anaconda3/lib/python3.6/site-packages/tensorflow/python/layers/base.py", line 575, in call outputs = self.call(inputs, *args, **kwargs) File "/home/sunkunyang/anaconda3/lib/python3.6/site-packages/tensorflow/python/layers/pooling.py", line 266, in call data_format=utils.convert_data_format(self.data_format, 4)) File "/home/sunkunyang/anaconda3/lib/python3.6/site-packages/tensorflow/python/ops/nn_ops.py", line 1958, in max_pool name=name) File "/home/sunkunyang/anaconda3/lib/python3.6/site-packages/tensorflow/python/ops/gen_nn_ops.py", line 2806, in _max_pool data_format=data_format, name=name) File "/home/sunkunyang/anaconda3/lib/python3.6/site-packages/tensorflow/python/framework/op_def_library.py", line 787, in _apply_op_helper op_def=op_def) File "/home/sunkunyang/anaconda3/lib/python3.6/site-packages/tensorflow/python/framework/ops.py", line 2956, in create_op op_def=op_def) File "/home/sunkunyang/anaconda3/lib/python3.6/site-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): Default MaxPoolingOp only supports NHWC. [[Node: ssd_300_vgg/pool1/MaxPool = MaxPoolT=DT_FLOAT, data_format="NCHW", ksize=[1, 1, 2, 2], padding="SAME", strides=[1, 1, 2, 2], _device="/job:localhost/replica:0/task:0/device:CPU:0"]]

INFO:tensorflow:global_step/sec: 0 2018-07-29 16:38:25.204381: E tensorflow/core/common_runtime/executor.cc:643] Executor failed to create kernel. Invalid argument: Default MaxPoolingOp only supports NHWC. [[Node: ssd_300_vgg/pool1/MaxPool = MaxPoolT=DT_FLOAT, data_format="NCHW", ksize=[1, 1, 2, 2], padding="SAME", strides=[1, 1, 2, 2], _device="/job:localhost/replica:0/task:0/device:CPU:0"]] Traceback (most recent call last): File "/home/sunkunyang/anaconda3/lib/python3.6/site-packages/tensorflow/python/client/session.py", line 1323, in _do_call return fn(*args) File "/home/sunkunyang/anaconda3/lib/python3.6/site-packages/tensorflow/python/client/session.py", line 1302, in _run_fn status, run_metadata) File "/home/sunkunyang/anaconda3/lib/python3.6/site-packages/tensorflow/python/framework/errors_impl.py", line 473, in exit c_api.TF_GetCode(self.status.status)) tensorflow.python.framework.errors_impl.InvalidArgumentError: Default MaxPoolingOp only supports NHWC. [[Node: ssd_300_vgg/pool1/MaxPool = MaxPoolT=DT_FLOAT, data_format="NCHW", ksize=[1, 1, 2, 2], padding="SAME", strides=[1, 1, 2, 2], _device="/job:localhost/replica:0/task:0/device:CPU:0"]]

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/home/sunkunyang/anaconda3/lib/python3.6/site-packages/tensorflow/python/training/supervisor.py", line 954, in managed_session yield sess File "/home/sunkunyang/anaconda3/lib/python3.6/site-packages/tensorflow/contrib/slim/python/slim/learning.py", line 763, in train sess, train_op, global_step, train_step_kwargs) File "/home/sunkunyang/anaconda3/lib/python3.6/site-packages/tensorflow/contrib/slim/python/slim/learning.py", line 487, in train_step run_metadata=run_metadata) File "/home/sunkunyang/anaconda3/lib/python3.6/site-packages/tensorflow/python/client/session.py", line 889, in run run_metadata_ptr) File "/home/sunkunyang/anaconda3/lib/python3.6/site-packages/tensorflow/python/client/session.py", line 1120, in _run feed_dict_tensor, options, run_metadata) File "/home/sunkunyang/anaconda3/lib/python3.6/site-packages/tensorflow/python/client/session.py", line 1317, in _do_run options, run_metadata) File "/home/sunkunyang/anaconda3/lib/python3.6/site-packages/tensorflow/python/client/session.py", line 1336, in _do_call raise type(e)(node_def, op, message) tensorflow.python.framework.errors_impl.InvalidArgumentError: Default MaxPoolingOp only supports NHWC. [[Node: ssd_300_vgg/pool1/MaxPool = MaxPoolT=DT_FLOAT, data_format="NCHW", ksize=[1, 1, 2, 2], padding="SAME", strides=[1, 1, 2, 2], _device="/job:localhost/replica:0/task:0/device:CPU:0"]]

Caused by op 'ssd_300_vgg/pool1/MaxPool', defined at: File "./train_ssd_network.py", line 391, in tf.app.run() File "/home/sunkunyang/anaconda3/lib/python3.6/site-packages/tensorflow/python/platform/app.py", line 48, in run _sys.exit(main(_sys.argv[:1] + flags_passthrough)) File "./train_ssd_network.py", line 292, in main clones = model_deploy.create_clones(deploy_config, clone_fn, [batch_queue]) File "/home/sunkunyang/PycharmProjects/SSD-Tensorflow-master/deployment/model_deploy.py", line 196, in create_clones outputs = model_fn(*args, kwargs) File "./train_ssd_network.py", line 276, in clone_fn ssd_net.net(b_image, is_training=True) File "/home/sunkunyang/PycharmProjects/SSD-Tensorflow-master/nets/ssd_vgg_300.py", line 155, in net scope=scope) File "/home/sunkunyang/PycharmProjects/SSD-Tensorflow-master/nets/ssd_vgg_300.py", line 454, in ssd_net net = slim.max_pool2d(net, [2, 2], scope='pool1') File "/home/sunkunyang/anaconda3/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 "/home/sunkunyang/anaconda3/lib/python3.6/site-packages/tensorflow/contrib/layers/python/layers/layers.py", line 2142, in max_pool2d outputs = layer.apply(inputs) File "/home/sunkunyang/anaconda3/lib/python3.6/site-packages/tensorflow/python/layers/base.py", line 671, in apply return self.call(inputs, args, kwargs) File "/home/sunkunyang/anaconda3/lib/python3.6/site-packages/tensorflow/python/layers/base.py", line 575, in call outputs = self.call(inputs, *args, **kwargs) File "/home/sunkunyang/anaconda3/lib/python3.6/site-packages/tensorflow/python/layers/pooling.py", line 266, in call data_format=utils.convert_data_format(self.data_format, 4)) File "/home/sunkunyang/anaconda3/lib/python3.6/site-packages/tensorflow/python/ops/nn_ops.py", line 1958, in max_pool name=name) File "/home/sunkunyang/anaconda3/lib/python3.6/site-packages/tensorflow/python/ops/gen_nn_ops.py", line 2806, in _max_pool data_format=data_format, name=name) File "/home/sunkunyang/anaconda3/lib/python3.6/site-packages/tensorflow/python/framework/op_def_library.py", line 787, in _apply_op_helper op_def=op_def) File "/home/sunkunyang/anaconda3/lib/python3.6/site-packages/tensorflow/python/framework/ops.py", line 2956, in create_op op_def=op_def) File "/home/sunkunyang/anaconda3/lib/python3.6/site-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): Default MaxPoolingOp only supports NHWC. [[Node: ssd_300_vgg/pool1/MaxPool = MaxPoolT=DT_FLOAT, data_format="NCHW", ksize=[1, 1, 2, 2], padding="SAME", strides=[1, 1, 2, 2], _device="/job:localhost/replica:0/task:0/device:CPU:0"]]