ValueError: No data files found in satellite/data\satellite_train_*.tfrecord

跟着书做"打造自己的图片识别模型"项目时候遇到报错,报错早不到数据文件,但是文件路径和数据都没问题

D:\Anaconda\anaconda\envs\tensorflow\python.exe D:/PyCharm/PycharmProjects/chapter_3/slim/train_image_classifier.py --train_dir=satellite/train_dir --dataset_name=satellite --dataset_split_name=train --dataset_dir=satellite/data --model_name=inception_v3 --checkpoint_path=satellite/pretrained/inception_v3.ckpt --checkpoint_exclude_scopes=InceptionV3/Logits,InceptionV3/AuxLogits --trainable_scopes=InceptionV3/Logits,InceptionV3/AuxLogits --max_number_of_steps=100000 --batch_size=32 --learning_rate=0.001 --learning_rate_decay_type=fixed --save_interval_secs=300 --save_summaries_secs=2 --log_every_n_steps=10 --optimizer=rmsprop --weight_decay=0.00004
WARNING:tensorflow:From D:/PyCharm/PycharmProjects/chapter_3/slim/train_image_classifier.py:397: create_global_step (from tensorflow.contrib.framework.python.ops.variables) is deprecated and will be removed in a future version.
Instructions for updating:
Please switch to tf.train.create_global_step
Traceback (most recent call last):
File "D:/PyCharm/PycharmProjects/chapter_3/slim/train_image_classifier.py", line 572, in
tf.app.run()
File "D:\Anaconda\anaconda\envs\tensorflow\lib\site-packages\tensorflow\python\platform\app.py", line 48, in run
sys.exit(main(_sys.argv[:1] + flags_passthrough))
File "D:/PyCharm/PycharmProjects/chapter_3/slim/train_image_classifier.py", line 430, in main
common_queue_min=10 * FLAGS.batch_size)
File "D:\Anaconda\anaconda\envs\tensorflow\lib\site-packages\tensorflow\contrib\slim\python\slim\data\dataset_data_provider.py", line 94, in __init
_
scope=scope)
File "D:\Anaconda\anaconda\envs\tensorflow\lib\site-packages\tensorflow\contrib\slim\python\slim\data\parallel_reader.py", line 238, in parallel_read
data_files = get_data_files(data_sources)
File "D:\Anaconda\anaconda\envs\tensorflow\lib\site-packages\tensorflow\contrib\slim\python\slim\data\parallel_reader.py", line 311, in get_data_files
raise ValueError('No data files found in %s' % (data_sources,))
ValueError: No data files found in satellite/data\satellite_train_*.tfrecord

weixin_43106248
weixin_43106248 回复Amanda-hb: 查看一下你satellite.py中的_FILE_PATTERN等是否写错了。_FILE_PATTERN = 'satellite_%s_*.tfrecord' SPLITS_TO_SIZES = {'train': 4800, 'validation': 1200} _NUM_CLASSES = 6
11 个月之前 回复
qq_39060327
Amanda-hb 请问您这个问题最终是怎么解决的?我也遇到了同样的问题,一直解决不了。
11 个月之前 回复

2个回答

执行报错为什么呢

WARNING: The TensorFlow contrib module will not be included in TensorFlow 2.0.
For more information, please see:

WARNING:tensorflow:From /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/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 /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/tensorflow/contrib/slim/python/slim/data/parallel_reader.py:242: string_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(string_tensor).shuffle(tf.shape(input_tensor, out_type=tf.int64)[0]).repeat(num_epochs). If shuffle=False, omit the .shuffle(...).
WARNING:tensorflow:From /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/tensorflow/python/training/input.py:278: 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 /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/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 /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/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 /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/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 /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/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.
WARNING:tensorflow:From /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/tensorflow/contrib/slim/python/slim/data/parallel_reader.py:94: TFRecordReader.__init__ (from tensorflow.python.ops.io_ops) 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.TFRecordDataset.
WARNING:tensorflow:From /Users/jiashihui/Documents/python_namespace/project_21/ImageRecognize/slim/preprocessing/inception_preprocessing.py:148: sample_distorted_bounding_box (from tensorflow.python.ops.image_ops_impl) is deprecated and will be removed in a future version.
Instructions for updating:
seed2 arg is deprecated.Use sample_distorted_bounding_box_v2 instead.
WARNING:tensorflow:From train_image_classifier.py:458: 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.batch(batch_size) (or padded_batch(...) if dynamic_pad=True).
WARNING:tensorflow:From /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/tensorflow/python/keras/layers/core.py:143: calling dropout (from tensorflow.python.ops.nn_ops) with keep_prob is deprecated and will be removed in a future version.
Instructions for updating:
Please use rate instead of keep_prob. Rate should be set to rate = 1 - keep_prob.
WARNING:tensorflow:From train_image_classifier.py:479: softmax_cross_entropy (from tensorflow.contrib.losses.python.losses.loss_ops) is deprecated and will be removed after 2016-12-30.
Instructions for updating:
Use tf.losses.softmax_cross_entropy instead. Note that the order of the logits and labels arguments has been changed.
WARNING:tensorflow:From /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/tensorflow/contrib/losses/python/losses/loss_ops.py:370: softmax_cross_entropy_with_logits (from tensorflow.python.ops.nn_ops) is deprecated and will be removed in a future version.
Instructions for updating:

Future major versions of TensorFlow will allow gradients to flow
into the labels input on backprop by default.

See tf.nn.softmax_cross_entropy_with_logits_v2.

WARNING:tensorflow:From /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/tensorflow/contrib/losses/python/losses/loss_ops.py:371: compute_weighted_loss (from tensorflow.contrib.losses.python.losses.loss_ops) is deprecated and will be removed after 2016-12-30.
Instructions for updating:
Use tf.losses.compute_weighted_loss instead.
WARNING:tensorflow:From /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/tensorflow/contrib/losses/python/losses/loss_ops.py:151: div (from tensorflow.python.ops.math_ops) is deprecated and will be removed in a future version.
Instructions for updating:
Deprecated in favor of operator or tf.math.divide.
WARNING:tensorflow:From /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/tensorflow/contrib/losses/python/losses/loss_ops.py:120: add_arg_scope..func_with_args (from tensorflow.contrib.losses.python.losses.loss_ops) is deprecated and will be removed after 2016-12-30.
Instructions for updating:
Use tf.losses.add_loss instead.
INFO:tensorflow:Fine-tuning from satellite/pretrained/inception_v3.ckpt
WARNING:tensorflow:From /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/tensorflow/contrib/slim/python/slim/learning.py:737: Supervisor.__init__ (from tensorflow.python.training.supervisor) is deprecated and will be removed in a future version.
Instructions for updating:
Please switch to tf.train.MonitoredTrainingSession
2019-06-06 14:05:13.877400: I tensorflow/core/platform/cpu_feature_guard.cc:141] Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX2 FMA
INFO:tensorflow:Error reported to Coordinator: , Cannot assign a device for operation InceptionV3/InceptionV3/Conv2d_1a_3x3/kernel/Regularizer/l2_regularizer/L2Loss: node InceptionV3/InceptionV3/Conv2d_1a_3x3/kernel/Regularizer/l2_regularizer/L2Loss (defined at /Users/jiashihui/Documents/python_namespace/project_21/ImageRecognize/slim/nets/inception_v3.py:104) was explicitly assigned to /device:GPU:0 but available devices are [ /job:localhost/replica:0/task:0/device:CPU:0 ]. Make sure the device specification refers to a valid device. The requested device appears to be a GPU, but CUDA is not enabled.
[[node InceptionV3/InceptionV3/Conv2d_1a_3x3/kernel/Regularizer/l2_regularizer/L2Loss (defined at /Users/jiashihui/Documents/python_namespace/project_21/ImageRecognize/slim/nets/inception_v3.py:104) ]]

Caused by op 'InceptionV3/InceptionV3/Conv2d_1a_3x3/kernel/Regularizer/l2_regularizer/L2Loss', defined at:
File "train_image_classifier.py", line 590, in
tf.app.run()
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/tensorflow/python/platform/app.py", line 125, in run
sys.exit(main(argv))
File "train_image_classifier.py", line 487, in main
clones = model_deploy.create_clones(deploy_config, clone_fn, [batch_queue])
File "/Users/jiashihui/Documents/python_namespace/project_21/ImageRecognize/slim/deployment/model_deploy.py", line 193, in create_clones
outputs = model_fn(*args, **kwargs)
File "train_image_classifier.py", line 470, in clone_fn
logits, end_points = network_fn(images)
File "/Users/jiashihui/Documents/python_namespace/project_21/ImageRecognize/slim/nets/nets_factory.py", line 155, in network_fn
**kwargs)
File "/Users/jiashihui/Documents/python_namespace/project_21/ImageRecognize/slim/nets/inception_v3.py", line 490, in inception_v3
depth_multiplier=depth_multiplier)
File "/Users/jiashihui/Documents/python_namespace/project_21/ImageRecognize/slim/nets/inception_v3.py", line 104, in inception_v3_base
net = slim.conv2d(inputs, depth(32), [3, 3], stride=2, scope=end_point)
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/tensorflow/contrib/framework/python/ops/arg_scope.py", line 182, in func_with_args
return func(*args, **current_args)
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/tensorflow/contrib/layers/python/layers/layers.py", line 1155, in convolution2d
conv_dims=2)
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/tensorflow/contrib/framework/python/ops/arg_scope.py", line 182, in func_with_args
return func(*args, **current_args)
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/tensorflow/contrib/layers/python/layers/layers.py", line 1058, in convolution
outputs = layer.apply(inputs)
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/tensorflow/python/keras/engine/base_layer.py", line 1227, in apply
return self.
_call__(inputs, *args, **kwargs)
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/tensorflow/python/layers/base.py", line 530, in call
outputs = super(Layer, self).__call__(inputs, *args, **kwargs)
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/tensorflow/python/keras/engine/base_layer.py", line 538, in call
self._maybe_build(inputs)
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/tensorflow/python/keras/engine/base_layer.py", line 1603, in maybe_build
self.build(input_shapes)
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/tensorflow/python/keras/layers/convolutional.py", line 165, in build
dtype=self.dtype)
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/tensorflow/python/layers/base.py", line 440, in add_weight
self._handle_weight_regularization(name, variable, regularizer)
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/tensorflow/python/keras/engine/base_layer.py", line 1333, in _handle_weight_regularization
self.add_loss(functools.partial(_loss_for_variable, variable))
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/tensorflow/python/layers/base.py", line 273, in add_loss
loss_tensor = regularizer()
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/tensorflow/python/keras/engine/base_layer.py", line 710, in _tag_unconditional
loss = loss()
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/tensorflow/python/keras/engine/base_layer.py", line 1326, in _loss_for_variable
regularization = regularizer(v)
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/tensorflow/contrib/layers/python/layers/regularizers.py", line 107, in l2
return standard_ops.multiply(my_scale, nn.l2_loss(weights), name=name)
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/tensorflow/python/ops/gen_nn_ops.py", line 4615, in l2_loss
"L2Loss", t=t, name=name)
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/tensorflow/python/framework/op_def_library.py", line 788, in _apply_op_helper
op_def=op_def)
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/tensorflow/python/util/deprecation.py", line 507, in new_func
return func(*args, **kwargs)
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/tensorflow/python/framework/ops.py", line 3300, in create_op
op_def=op_def)
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/tensorflow/python/framework/ops.py", line 1801, in __init
_
self._traceback = tf_stack.extract_stack()

InvalidArgumentError (see above for traceback): Cannot assign a device for operation InceptionV3/InceptionV3/Conv2d_1a_3x3/kernel/Regularizer/l2_regularizer/L2Loss: node InceptionV3/InceptionV3/Conv2d_1a_3x3/kernel/Regularizer/l2_regularizer/L2Loss (defined at /Users/jiashihui/Documents/python_namespace/project_21/ImageRecognize/slim/nets/inception_v3.py:104) was explicitly assigned to /device:GPU:0 but available devices are [ /job:localhost/replica:0/task:0/device:CPU:0 ]. Make sure the device specification refers to a valid device. The requested device appears to be a GPU, but CUDA is not enabled.
[[node InceptionV3/InceptionV3/Conv2d_1a_3x3/kernel/Regularizer/l2_regularizer/L2Loss (defined at /Users/jiashihui/Documents/python_namespace/project_21/ImageRecognize/slim/nets/inception_v3.py:104) ]]

Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/tensorflow/python/client/session.py", line 1334, in _do_call
return fn(*args)
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/tensorflow/python/client/session.py", line 1317, in _run_fn
self._extend_graph()
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/tensorflow/python/client/session.py", line 1352, in _extend_graph
tf_session.ExtendSession(self._session)
tensorflow.python.framework.errors_impl.InvalidArgumentError: Cannot assign a device for operation InceptionV3/InceptionV3/Conv2d_1a_3x3/kernel/Regularizer/l2_regularizer/L2Loss: {{node InceptionV3/InceptionV3/Conv2d_1a_3x3/kernel/Regularizer/l2_regularizer/L2Loss}}was explicitly assigned to /device:GPU:0 but available devices are [ /job:localhost/replica:0/task:0/device:CPU:0 ]. Make sure the device specification refers to a valid device. The requested device appears to be a GPU, but CUDA is not enabled.
[[{{node InceptionV3/InceptionV3/Conv2d_1a_3x3/kernel/Regularizer/l2_regularizer/L2Loss}}]]

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "train_image_classifier.py", line 590, in
tf.app.run()
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/tensorflow/python/platform/app.py", line 125, in run
sys.exit(main(argv))
File "train_image_classifier.py", line 586, in main
sync_optimizer=optimizer if FLAGS.sync_replicas else None)
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/tensorflow/contrib/slim/python/slim/learning.py", line 748, in train
master, start_standard_services=False, config=session_config) as sess:
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/contextlib.py", line 112, in __enter
_
return next(self.gen)
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/tensorflow/python/training/supervisor.py", line 1004, in managed_session
self.stop(close_summary_writer=close_summary_writer)
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/tensorflow/python/training/supervisor.py", line 832, in stop
ignore_live_threads=ignore_live_threads)
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/tensorflow/python/training/coordinator.py", line 389, in join
six.reraise(*self._exc_info_to_raise)
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/six.py", line 693, in reraise
raise value
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/tensorflow/python/training/supervisor.py", line 993, in managed_session
start_standard_services=start_standard_services)
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/tensorflow/python/training/supervisor.py", line 730, in prepare_or_wait_for_session
init_feed_dict=self._init_feed_dict, init_fn=self._init_fn)
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/tensorflow/python/training/session_manager.py", line 287, in prepare_session
sess.run(init_op, feed_dict=init_feed_dict)
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/tensorflow/python/client/session.py", line 929, in run
run_metadata_ptr)
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/tensorflow/python/client/session.py", line 1152, in _run
feed_dict_tensor, options, run_metadata)
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/tensorflow/python/client/session.py", line 1328, in _do_run
run_metadata)
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/tensorflow/python/client/session.py", line 1348, in _do_call
raise type(e)(node_def, op, message)
tensorflow.python.framework.errors_impl.InvalidArgumentError: Cannot assign a device for operation InceptionV3/InceptionV3/Conv2d_1a_3x3/kernel/Regularizer/l2_regularizer/L2Loss: node InceptionV3/InceptionV3/Conv2d_1a_3x3/kernel/Regularizer/l2_regularizer/L2Loss (defined at /Users/jiashihui/Documents/python_namespace/project_21/ImageRecognize/slim/nets/inception_v3.py:104) was explicitly assigned to /device:GPU:0 but available devices are [ /job:localhost/replica:0/task:0/device:CPU:0 ]. Make sure the device specification refers to a valid device. The requested device appears to be a GPU, but CUDA is not enabled.
[[node InceptionV3/InceptionV3/Conv2d_1a_3x3/kernel/Regularizer/l2_regularizer/L2Loss (defined at /Users/jiashihui/Documents/python_namespace/project_21/ImageRecognize/slim/nets/inception_v3.py:104) ]]

Caused by op 'InceptionV3/InceptionV3/Conv2d_1a_3x3/kernel/Regularizer/l2_regularizer/L2Loss', defined at:
File "train_image_classifier.py", line 590, in
tf.app.run()
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/tensorflow/python/platform/app.py", line 125, in run
sys.exit(main(argv))
File "train_image_classifier.py", line 487, in main
clones = model_deploy.create_clones(deploy_config, clone_fn, [batch_queue])
File "/Users/jiashihui/Documents/python_namespace/project_21/ImageRecognize/slim/deployment/model_deploy.py", line 193, in create_clones
outputs = model_fn(*args, **kwargs)
File "train_image_classifier.py", line 470, in clone_fn
logits, end_points = network_fn(images)
File "/Users/jiashihui/Documents/python_namespace/project_21/ImageRecognize/slim/nets/nets_factory.py", line 155, in network_fn
**kwargs)
File "/Users/jiashihui/Documents/python_namespace/project_21/ImageRecognize/slim/nets/inception_v3.py", line 490, in inception_v3
depth_multiplier=depth_multiplier)
File "/Users/jiashihui/Documents/python_namespace/project_21/ImageRecognize/slim/nets/inception_v3.py", line 104, in inception_v3_base
net = slim.conv2d(inputs, depth(32), [3, 3], stride=2, scope=end_point)
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/tensorflow/contrib/framework/python/ops/arg_scope.py", line 182, in func_with_args
return func(*args, **current_args)
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/tensorflow/contrib/layers/python/layers/layers.py", line 1155, in convolution2d
conv_dims=2)
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/tensorflow/contrib/framework/python/ops/arg_scope.py", line 182, in func_with_args
return func(*args, **current_args)
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/tensorflow/contrib/layers/python/layers/layers.py", line 1058, in convolution
outputs = layer.apply(inputs)
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/tensorflow/python/keras/engine/base_layer.py", line 1227, in apply
return self.
_call__(inputs, *args, **kwargs)
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/tensorflow/python/layers/base.py", line 530, in call
outputs = super(Layer, self).__call__(inputs, *args, **kwargs)
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/tensorflow/python/keras/engine/base_layer.py", line 538, in call
self._maybe_build(inputs)
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/tensorflow/python/keras/engine/base_layer.py", line 1603, in maybe_build
self.build(input_shapes)
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/tensorflow/python/keras/layers/convolutional.py", line 165, in build
dtype=self.dtype)
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/tensorflow/python/layers/base.py", line 440, in add_weight
self._handle_weight_regularization(name, variable, regularizer)
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/tensorflow/python/keras/engine/base_layer.py", line 1333, in _handle_weight_regularization
self.add_loss(functools.partial(_loss_for_variable, variable))
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/tensorflow/python/layers/base.py", line 273, in add_loss
loss_tensor = regularizer()
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/tensorflow/python/keras/engine/base_layer.py", line 710, in _tag_unconditional
loss = loss()
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/tensorflow/python/keras/engine/base_layer.py", line 1326, in _loss_for_variable
regularization = regularizer(v)
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/tensorflow/contrib/layers/python/layers/regularizers.py", line 107, in l2
return standard_ops.multiply(my_scale, nn.l2_loss(weights), name=name)
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/tensorflow/python/ops/gen_nn_ops.py", line 4615, in l2_loss
"L2Loss", t=t, name=name)
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/tensorflow/python/framework/op_def_library.py", line 788, in _apply_op_helper
op_def=op_def)
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/tensorflow/python/util/deprecation.py", line 507, in new_func
return func(*args, **kwargs)
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/tensorflow/python/framework/ops.py", line 3300, in create_op
op_def=op_def)
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/tensorflow/python/framework/ops.py", line 1801, in __init
_
self._traceback = tf_stack.extract_stack()

InvalidArgumentError (see above for traceback): Cannot assign a device for operation InceptionV3/InceptionV3/Conv2d_1a_3x3/kernel/Regularizer/l2_regularizer/L2Loss: node InceptionV3/InceptionV3/Conv2d_1a_3x3/kernel/Regularizer/l2_regularizer/L2Loss (defined at /Users/jiashihui/Documents/python_namespace/project_21/ImageRecognize/slim/nets/inception_v3.py:104) was explicitly assigned to /device:GPU:0 but available devices are [ /job:localhost/replica:0/task:0/device:CPU:0 ]. Make sure the device specification refers to a valid device. The requested device appears to be a GPU, but CUDA is not enabled.
[[node InceptionV3/InceptionV3/Conv2d_1a_3x3/kernel/Regularizer/l2_regularizer/L2Loss (defined at /Users/jiashihui/Documents/python_namespace/project_21/ImageRecognize/slim/nets/inception_v3.py:104) ]]

ERROR:tensorflow:==================================
Object was never used (type ):

If you want to mark it as used call its "mark_used()" method.
It was originally created here:
File "train_image_classifier.py", line 590, in
tf.app.run() File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/tensorflow/python/platform/app.py", line 125, in run
_sys.exit(main(argv)) File "train_image_classifier.py", line 586, in main
sync_optimizer=optimizer if FLAGS.sync_replicas else None) File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/tensorflow/contrib/slim/python/slim/learning.py", line 791, in train
should_retry = True File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/tensorflow/python/util/tf_should_use.py", line 193, in wrapped
return _add_should_use_warning(fn(*args, **kwargs))

sinat_41780257
sinat_41780257 回复Adrenline: 请问解决了吗
2 个月之前 回复
Adrenline
Adrenline 看最后几行我们错误差不多!请问解决了吗?
8 个月之前 回复

为什么你的路径一会儿正斜杠一会儿反斜杠,检查下。还有你的文件名satellite_train_某某.tfrecord是不是这样的。用绝对路径看看

WellTung_666
WellTung_666 应该不是路径问题,路径问题应该是报错没有这文件的。 说没有找到数据文件,但是我的文件命名和路径都没有错。
一年多之前 回复
Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
立即提问