Hi-Tensorflow用户和社区,
我在运行对象检测教程时遇到了一些问题,我不知道安装是否有问题,但所有命令都成功退出了,我陷入了困境。
- Protobuf版本:3.12.4
- Python版本:Python 3.8.5
- tensorboard2.3.0
- tensorboard插件,1.7.0
- tensorflow2.3.0
- tensorflow插件0.11.0
- tensorflow数据集3.2.1
- tensorflow估计器2.3.0
- tensorflow轮毂0.8.0
- tensorflow元数据0.22.2
- tensorflow模型优化0.4.1
- 目标检测:0.1
注意,对象检测是从模型的git安装的,因为它在文档中很突出:
# From within TensorFlow/models/research/
cp object_detection/packages/tf2/setup.py .
python -m pip install .
有问题的命令是测试对象检测安装的最后一个命令:
python object_detection/builders/model_builder_tf2_test.py
我得到了几个断言错误,其中一些例子是:
[ FAILED ] ModelBuilderTF2Test.test_create_center_net_model
[ RUN ] ModelBuilderTF2Test.test_create_experimental_model
INFO:tensorflow:time(__main__.ModelBuilderTF2Test.test_create_experimental_model): 0.0s
I0806 12:27:07.016419 4260 test_util.py:1972] time(__main__.ModelBuilderTF2Test.test_create_experimental_model): 0.0s
[ OK ] ModelBuilderTF2Test.test_create_experimental_model
[ RUN ] ModelBuilderTF2Test.test_create_faster_rcnn_from_config_with_crop_feature(True)
第一个断言的完整跟踪:
======================================================================
ERROR: test_create_center_net_model (__main__.ModelBuilderTF2Test)
test_create_center_net_model (__main__.ModelBuilderTF2Test)
Test building a CenterNet model from proto txt.
----------------------------------------------------------------------
Traceback (most recent call last):
File "object_detection/builders/model_builder_tf2_test.py", line 224, in test_create_center_net_model
model = model_builder.build(config, is_training=True)
File "C:UsersIuriAndreazzaAppDataRoamingPythonPython38site-packagesobject_detectionbuildersmodel_builder.py", line 1015, in build
return build_func(getattr(model_config, meta_architecture), is_training,
File "C:UsersIuriAndreazzaAppDataRoamingPythonPython38site-packagesobject_detectionbuildersmodel_builder.py", line 915, in _build_center_net_model
feature_extractor = _build_center_net_feature_extractor(
File "C:UsersIuriAndreazzaAppDataRoamingPythonPython38site-packagesobject_detectionbuildersmodel_builder.py", line 977, in _build_center_net_feature_extractor
return CENTER_NET_EXTRACTOR_FUNCTION_MAP[feature_extractor_config.type](
File "C:UsersIuriAndreazzaAppDataRoamingPythonPython38site-packagesobject_detectionmodelscenter_net_resnet_feature_extractor.py", line 141, in resnet_v2_101
return CenterNetResnetFeatureExtractor(
File "C:UsersIuriAndreazzaAppDataRoamingPythonPython38site-packagesobject_detectionmodelscenter_net_resnet_feature_extractor.py", line 45, in __init__
super(CenterNetResnetFeatureExtractor, self).__init__(
File "C:UsersIuriAndreazzaAppDataRoamingPythonPython38site-packagesobject_detectionmeta_architecturescenter_net_meta_arch.py", line 71, in __init__
super(CenterNetFeatureExtractor, self).__init__(name=name)
File "C:UsersIuriAndreazzaAppDataRoamingPythonPython38site-packagestensorflowpythontrainingtrackingbase.py", line 457, in _method_wrapper
result = method(self, *args, **kwargs)
File "C:UsersIuriAndreazzaAppDataRoamingPythonPython38site-packagestensorflowpythonkerasenginetraining.py", line 308, in __init__
self._init_batch_counters()
File "C:UsersIuriAndreazzaAppDataRoamingPythonPython38site-packagestensorflowpythontrainingtrackingbase.py", line 457, in _method_wrapper
result = method(self, *args, **kwargs)
File "C:UsersIuriAndreazzaAppDataRoamingPythonPython38site-packagestensorflowpythonkerasenginetraining.py", line 317, in _init_batch_counters
self._train_counter = variables.Variable(0, dtype='int64', aggregation=agg)
File "C:UsersIuriAndreazzaAppDataRoamingPythonPython38site-packagestensorflowpythonopsvariables.py", line 262, in __call__
return cls._variable_v2_call(*args, **kwargs)
File "C:UsersIuriAndreazzaAppDataRoamingPythonPython38site-packagestensorflowpythonopsvariables.py", line 244, in _variable_v2_call
return previous_getter(
File "C:UsersIuriAndreazzaAppDataRoamingPythonPython38site-packagestensorflowpythonopsvariables.py", line 237, in <lambda>
previous_getter = lambda **kws: default_variable_creator_v2(None, **kws)
File "C:UsersIuriAndreazzaAppDataRoamingPythonPython38site-packagestensorflowpythonopsvariable_scope.py", line 2633, in default_variable_creator_v2
return resource_variable_ops.ResourceVariable(
File "C:UsersIuriAndreazzaAppDataRoamingPythonPython38site-packagestensorflowpythonopsvariables.py", line 264, in __call__
return super(VariableMetaclass, cls).__call__(*args, **kwargs)
File "C:UsersIuriAndreazzaAppDataRoamingPythonPython38site-packagestensorflowpythonopsresource_variable_ops.py", line 1507, in __init__
self._init_from_args(
File "C:UsersIuriAndreazzaAppDataRoamingPythonPython38site-packagestensorflowpythonopsresource_variable_ops.py", line 1661, in _init_from_args
handle = eager_safe_variable_handle(
File "C:UsersIuriAndreazzaAppDataRoamingPythonPython38site-packagestensorflowpythonopsresource_variable_ops.py", line 242, in eager_safe_variable_handle
return _variable_handle_from_shape_and_dtype(
File "C:UsersIuriAndreazzaAppDataRoamingPythonPython38site-packagestensorflowpythonopsresource_variable_ops.py", line 174, in _variable_handle_from_shape_and_dtype
gen_logging_ops._assert( # pylint: disable=protected-access
File "C:UsersIuriAndreazzaAppDataRoamingPythonPython38site-packagestensorflowpythonopsgen_logging_ops.py", line 49, in _assert
_ops.raise_from_not_ok_status(e, name)
File "C:UsersIuriAndreazzaAppDataRoamingPythonPython38site-packagestensorflowpythonframeworkops.py", line 6843, in raise_from_not_ok_status
six.raise_from(core._status_to_exception(e.code, message), None)
File "<string>", line 3, in raise_from
tensorflow.python.framework.errors_impl.InvalidArgumentError: assertion failed: [0] [Op:Assert] name: EagerVariableNameReuse
完整日志输出:
e:Desenvolvimentotensorflowmodelsresearch>python object_detection/builders/model_builder_tf2_test.py
2020-08-06 12:27:02.162481: I tensorflow/stream_executor/platform/default/dso_loader.cc:48] Successfully opened dynamic library cudart64_101.dll
Running tests under Python 3.8.5: C:Program FilesPython38python.exe
[ RUN ] ModelBuilderTF2Test.test_create_center_net_model
2020-08-06 12:27:06.544000: I tensorflow/stream_executor/platform/default/dso_loader.cc:48] Successfully opened dynamic library nvcuda.dll
2020-08-06 12:27:06.578948: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1716] Found device 0 with properties:
pciBusID: 0000:01:00.0 name: GeForce GTX 750 Ti computeCapability: 5.0
coreClock: 1.0845GHz coreCount: 5 deviceMemorySize: 2.00GiB deviceMemoryBandwidth: 80.47GiB/s
2020-08-06 12:27:06.580046: I tensorflow/stream_executor/platform/default/dso_loader.cc:48] Successfully opened dynamic library cudart64_101.dll
2020-08-06 12:27:06.585764: I tensorflow/stream_executor/platform/default/dso_loader.cc:48] Successfully opened dynamic library cublas64_10.dll
2020-08-06 12:27:06.591360: I tensorflow/stream_executor/platform/default/dso_loader.cc:48] Successfully opened dynamic library cufft64_10.dll
2020-08-06 12:27:06.593618: I tensorflow/stream_executor/platform/default/dso_loader.cc:48] Successfully opened dynamic library curand64_10.dll
2020-08-06 12:27:06.602037: I tensorflow/stream_executor/platform/default/dso_loader.cc:48] Successfully opened dynamic library cusolver64_10.dll
2020-08-06 12:27:06.605579: I tensorflow/stream_executor/platform/default/dso_loader.cc:48] Successfully opened dynamic library cusparse64_10.dll
2020-08-06 12:27:06.621708: I tensorflow/stream_executor/platform/default/dso_loader.cc:48] Successfully opened dynamic library cudnn64_7.dll
2020-08-06 12:27:06.622257: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1858] Adding visible gpu devices: 0
2020-08-06 12:27:06.636567: I tensorflow/compiler/xla/service/service.cc:168] XLA service 0x22c29ba5390 initialized for platform Host (this does not guarantee that XLA will be used). Devices:
2020-08-06 12:27:06.637042: I tensorflow/compiler/xla/service/service.cc:176] StreamExecutor device (0): Host, Default Version
2020-08-06 12:27:06.637604: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1716] Found device 0 with properties:
pciBusID: 0000:01:00.0 name: GeForce GTX 750 Ti computeCapability: 5.0
coreClock: 1.0845GHz coreCount: 5 deviceMemorySize: 2.00GiB deviceMemoryBandwidth: 80.47GiB/s
2020-08-06 12:27:06.638471: I tensorflow/stream_executor/platform/default/dso_loader.cc:48] Successfully opened dynamic library cudart64_101.dll
2020-08-06 12:27:06.638806: I tensorflow/stream_executor/platform/default/dso_loader.cc:48] Successfully opened dynamic library cublas64_10.dll
2020-08-06 12:27:06.639066: I tensorflow/stream_executor/platform/default/dso_loader.cc:48] Successfully opened dynamic library cufft64_10.dll
2020-08-06 12:27:06.639327: I tensorflow/stream_executor/platform/default/dso_loader.cc:48] Successfully opened dynamic library curand64_10.dll
2020-08-06 12:27:06.639595: I tensorflow/stream_executor/platform/default/dso_loader.cc:48] Successfully opened dynamic library cusolver64_10.dll
2020-08-06 12:27:06.639862: I tensorflow/stream_executor/platform/default/dso_loader.cc:48] Successfully opened dynamic library cusparse64_10.dll
2020-08-06 12:27:06.640216: I tensorflow/stream_executor/platform/default/dso_loader.cc:48] Successfully opened dynamic library cudnn64_7.dll
2020-08-06 12:27:06.640572: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1858] Adding visible gpu devices: 0
2020-08-06 12:27:06.720806: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1257] Device interconnect StreamExecutor with strength 1 edge matrix:
2020-08-06 12:27:06.721274: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1263] 0
2020-08-06 12:27:06.721713: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1276] 0: N
2020-08-06 12:27:06.722232: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1402] Created TensorFlow device (/job:localhost/replica:0/task:0/device:GPU:0 with 1455 MB memory) -> physical GPU (device: 0, name: GeForce GTX 750 Ti, pci bus id: 0000:01:00.0, compute capability: 5.0)
2020-08-06 12:27:06.726211: I tensorflow/compiler/xla/service/service.cc:168] XLA service 0x22c2a0972c0 initialized for platform CUDA (this does not guarantee that XLA will be used). Devices:
2020-08-06 12:27:06.726554: I tensorflow/compiler/xla/service/service.cc:176] StreamExecutor device (0): GeForce GTX 750 Ti, Compute Capability 5.0
INFO:tensorflow:time(__main__.ModelBuilderTF2Test.test_create_center_net_model): 1.4s
I0806 12:27:07.006418 4260 test_util.py:1972] time(__main__.ModelBuilderTF2Test.test_create_center_net_model): 1.4s
[ FAILED ] ModelBuilderTF2Test.test_create_center_net_model
[ RUN ] ModelBuilderTF2Test.test_create_experimental_model
INFO:tensorflow:time(__main__.ModelBuilderTF2Test.test_create_experimental_model): 0.0s
I0806 12:27:07.016419 4260 test_util.py:1972] time(__main__.ModelBuilderTF2Test.test_create_experimental_model): 0.0s
[ OK ] ModelBuilderTF2Test.test_create_experimental_model
[ RUN ] ModelBuilderTF2Test.test_create_faster_rcnn_from_config_with_crop_feature(True)
INFO:tensorflow:time(__main__.ModelBuilderTF2Test.test_create_faster_rcnn_from_config_with_crop_feature(True)): 0.02s
I0806 12:27:07.038428 4260 test_util.py:1972] time(__main__.ModelBuilderTF2Test.test_create_faster_rcnn_from_config_with_crop_feature(True)): 0.02s
[ FAILED ] ModelBuilderTF2Test.test_create_faster_rcnn_from_config_with_crop_feature(True)
[ RUN ] ModelBuilderTF2Test.test_create_faster_rcnn_from_config_with_crop_feature(False)
INFO:tensorflow:time(__main__.ModelBuilderTF2Test.test_create_faster_rcnn_from_config_with_crop_feature(False)): 0.01s
I0806 12:27:07.058416 4260 test_util.py:1972] time(__main__.ModelBuilderTF2Test.test_create_faster_rcnn_from_config_with_crop_feature(False)): 0.01s
[ FAILED ] ModelBuilderTF2Test.test_create_faster_rcnn_from_config_with_crop_feature(False)
[ RUN ] ModelBuilderTF2Test.test_create_faster_rcnn_model_from_config_with_example_miner
INFO:tensorflow:time(__main__.ModelBuilderTF2Test.test_create_faster_rcnn_model_from_config_with_example_miner): 0.01s
I0806 12:27:07.075416 4260 test_util.py:1972] time(__main__.ModelBuilderTF2Test.test_create_faster_rcnn_model_from_config_with_example_miner): 0.01s
[ FAILED ] ModelBuilderTF2Test.test_create_faster_rcnn_model_from_config_with_example_miner
[ RUN ] ModelBuilderTF2Test.test_create_faster_rcnn_models_from_config_faster_rcnn_with_matmul
INFO:tensorflow:time(__main__.ModelBuilderTF2Test.test_create_faster_rcnn_models_from_config_faster_rcnn_with_matmul): 0.01s
I0806 12:27:07.092416 4260 test_util.py:1972] time(__main__.ModelBuilderTF2Test.test_create_faster_rcnn_models_from_config_faster_rcnn_with_matmul): 0.01s
[ FAILED ] ModelBuilderTF2Test.test_create_faster_rcnn_models_from_config_faster_rcnn_with_matmul
[ RUN ] ModelBuilderTF2Test.test_create_faster_rcnn_models_from_config_faster_rcnn_without_matmul
INFO:tensorflow:time(__main__.ModelBuilderTF2Test.test_create_faster_rcnn_models_from_config_faster_rcnn_without_matmul): 0.01s
I0806 12:27:07.111420 4260 test_util.py:1972] time(__main__.ModelBuilderTF2Test.test_create_faster_rcnn_models_from_config_faster_rcnn_without_matmul): 0.01s
[ FAILED ] ModelBuilderTF2Test.test_create_faster_rcnn_models_from_config_faster_rcnn_without_matmul
[ RUN ] ModelBuilderTF2Test.test_create_faster_rcnn_models_from_config_mask_rcnn_with_matmul
INFO:tensorflow:time(__main__.ModelBuilderTF2Test.test_create_faster_rcnn_models_from_config_mask_rcnn_with_matmul): 0.02s
I0806 12:27:07.131419 4260 test_util.py:1972] time(__main__.ModelBuilderTF2Test.test_create_faster_rcnn_models_from_config_mask_rcnn_with_matmul): 0.02s
[ FAILED ] ModelBuilderTF2Test.test_create_faster_rcnn_models_from_config_mask_rcnn_with_matmul
[ RUN ] ModelBuilderTF2Test.test_create_faster_rcnn_models_from_config_mask_rcnn_without_matmul
INFO:tensorflow:time(__main__.ModelBuilderTF2Test.test_create_faster_rcnn_models_from_config_mask_rcnn_without_matmul): 0.02s
I0806 12:27:07.151418 4260 test_util.py:1972] time(__main__.ModelBuilderTF2Test.test_create_faster_rcnn_models_from_config_mask_rcnn_without_matmul): 0.02s
[ FAILED ] ModelBuilderTF2Test.test_create_faster_rcnn_models_from_config_mask_rcnn_without_matmul
[ RUN ] ModelBuilderTF2Test.test_create_rfcn_model_from_config
INFO:tensorflow:time(__main__.ModelBuilderTF2Test.test_create_rfcn_model_from_config): 0.02s
I0806 12:27:07.171454 4260 test_util.py:1972] time(__main__.ModelBuilderTF2Test.test_create_rfcn_model_from_config): 0.02s
[ FAILED ] ModelBuilderTF2Test.test_create_rfcn_model_from_config
[ RUN ] ModelBuilderTF2Test.test_create_ssd_fpn_model_from_config
INFO:tensorflow:time(__main__.ModelBuilderTF2Test.test_create_ssd_fpn_model_from_config): 0.01s
I0806 12:27:07.182456 4260 test_util.py:1972] time(__main__.ModelBuilderTF2Test.test_create_ssd_fpn_model_from_config): 0.01s
[ FAILED ] ModelBuilderTF2Test.test_create_ssd_fpn_model_from_config
[ RUN ] ModelBuilderTF2Test.test_create_ssd_models_from_config
INFO:tensorflow:time(__main__.ModelBuilderTF2Test.test_create_ssd_models_from_config): 0.01s
I0806 12:27:07.193453 4260 test_util.py:1972] time(__main__.ModelBuilderTF2Test.test_create_ssd_models_from_config): 0.01s
[ FAILED ] ModelBuilderTF2Test.test_create_ssd_models_from_config
[ RUN ] ModelBuilderTF2Test.test_invalid_faster_rcnn_batchnorm_update
INFO:tensorflow:time(__main__.ModelBuilderTF2Test.test_invalid_faster_rcnn_batchnorm_update): 0.0s
I0806 12:27:07.198454 4260 test_util.py:1972] time(__main__.ModelBuilderTF2Test.test_invalid_faster_rcnn_batchnorm_update): 0.0s
[ OK ] ModelBuilderTF2Test.test_invalid_faster_rcnn_batchnorm_update
[ RUN ] ModelBuilderTF2Test.test_invalid_first_stage_nms_iou_threshold
INFO:tensorflow:time(__main__.ModelBuilderTF2Test.test_invalid_first_stage_nms_iou_threshold): 0.0s
I0806 12:27:07.203454 4260 test_util.py:1972] time(__main__.ModelBuilderTF2Test.test_invalid_first_stage_nms_iou_threshold): 0.0s
[ OK ] ModelBuilderTF2Test.test_invalid_first_stage_nms_iou_threshold
[ RUN ] ModelBuilderTF2Test.test_invalid_model_config_proto
INFO:tensorflow:time(__main__.ModelBuilderTF2Test.test_invalid_model_config_proto): 0.0s
I0806 12:27:07.205455 4260 test_util.py:1972] time(__main__.ModelBuilderTF2Test.test_invalid_model_config_proto): 0.0s
[ OK ] ModelBuilderTF2Test.test_invalid_model_config_proto
[ RUN ] ModelBuilderTF2Test.test_invalid_second_stage_batch_size
INFO:tensorflow:time(__main__.ModelBuilderTF2Test.test_invalid_second_stage_batch_size): 0.0s
I0806 12:27:07.208452 4260 test_util.py:1972] time(__main__.ModelBuilderTF2Test.test_invalid_second_stage_batch_size): 0.0s
[ OK ] ModelBuilderTF2Test.test_invalid_second_stage_batch_size
[ RUN ] ModelBuilderTF2Test.test_session
[ SKIPPED ] ModelBuilderTF2Test.test_session
[ RUN ] ModelBuilderTF2Test.test_unknown_faster_rcnn_feature_extractor
INFO:tensorflow:time(__main__.ModelBuilderTF2Test.test_unknown_faster_rcnn_feature_extractor): 0.0s
I0806 12:27:07.212455 4260 test_util.py:1972] time(__main__.ModelBuilderTF2Test.test_unknown_faster_rcnn_feature_extractor): 0.0s
[ OK ] ModelBuilderTF2Test.test_unknown_faster_rcnn_feature_extractor
[ RUN ] ModelBuilderTF2Test.test_unknown_meta_architecture
INFO:tensorflow:time(__main__.ModelBuilderTF2Test.test_unknown_meta_architecture): 0.0s
I0806 12:27:07.213455 4260 test_util.py:1972] time(__main__.ModelBuilderTF2Test.test_unknown_meta_architecture): 0.0s
[ OK ] ModelBuilderTF2Test.test_unknown_meta_architecture
[ RUN ] ModelBuilderTF2Test.test_unknown_ssd_feature_extractor
INFO:tensorflow:time(__main__.ModelBuilderTF2Test.test_unknown_ssd_feature_extractor): 0.0s
I0806 12:27:07.217455 4260 test_util.py:1972] time(__main__.ModelBuilderTF2Test.test_unknown_ssd_feature_extractor): 0.0s
[ OK ] ModelBuilderTF2Test.test_unknown_ssd_feature_extractor
======================================================================
ERROR: test_create_center_net_model (__main__.ModelBuilderTF2Test)
test_create_center_net_model (__main__.ModelBuilderTF2Test)
Test building a CenterNet model from proto txt.
----------------------------------------------------------------------
Traceback (most recent call last):
File "object_detection/builders/model_builder_tf2_test.py", line 224, in test_create_center_net_model
model = model_builder.build(config, is_training=True)
File "C:UsersIuriAndreazzaAppDataRoamingPythonPython38site-packagesobject_detectionbuildersmodel_builder.py", line 1015, in build
return build_func(getattr(model_config, meta_architecture), is_training,
File "C:UsersIuriAndreazzaAppDataRoamingPythonPython38site-packagesobject_detectionbuildersmodel_builder.py", line 915, in _build_center_net_model
feature_extractor = _build_center_net_feature_extractor(
File "C:UsersIuriAndreazzaAppDataRoamingPythonPython38site-packagesobject_detectionbuildersmodel_builder.py", line 977, in _build_center_net_feature_extractor
return CENTER_NET_EXTRACTOR_FUNCTION_MAP[feature_extractor_config.type](
File "C:UsersIuriAndreazzaAppDataRoamingPythonPython38site-packagesobject_detectionmodelscenter_net_resnet_feature_extractor.py", line 141, in resnet_v2_101
return CenterNetResnetFeatureExtractor(
File "C:UsersIuriAndreazzaAppDataRoamingPythonPython38site-packagesobject_detectionmodelscenter_net_resnet_feature_extractor.py", line 45, in __init__
super(CenterNetResnetFeatureExtractor, self).__init__(
File "C:UsersIuriAndreazzaAppDataRoamingPythonPython38site-packagesobject_detectionmeta_architecturescenter_net_meta_arch.py", line 71, in __init__
super(CenterNetFeatureExtractor, self).__init__(name=name)
File "C:UsersIuriAndreazzaAppDataRoamingPythonPython38site-packagestensorflowpythontrainingtrackingbase.py", line 457, in _method_wrapper
result = method(self, *args, **kwargs)
File "C:UsersIuriAndreazzaAppDataRoamingPythonPython38site-packagestensorflowpythonkerasenginetraining.py", line 308, in __init__
self._init_batch_counters()
File "C:UsersIuriAndreazzaAppDataRoamingPythonPython38site-packagestensorflowpythontrainingtrackingbase.py", line 457, in _method_wrapper
result = method(self, *args, **kwargs)
File "C:UsersIuriAndreazzaAppDataRoamingPythonPython38site-packagestensorflowpythonkerasenginetraining.py", line 317, in _init_batch_counters
self._train_counter = variables.Variable(0, dtype='int64', aggregation=agg)
File "C:UsersIuriAndreazzaAppDataRoamingPythonPython38site-packagestensorflowpythonopsvariables.py", line 262, in __call__
return cls._variable_v2_call(*args, **kwargs)
File "C:UsersIuriAndreazzaAppDataRoamingPythonPython38site-packagestensorflowpythonopsvariables.py", line 244, in _variable_v2_call
return previous_getter(
File "C:UsersIuriAndreazzaAppDataRoamingPythonPython38site-packagestensorflowpythonopsvariables.py", line 237, in <lambda>
previous_getter = lambda **kws: default_variable_creator_v2(None, **kws)
File "C:UsersIuriAndreazzaAppDataRoamingPythonPython38site-packagestensorflowpythonopsvariable_scope.py", line 2633, in default_variable_creator_v2
return resource_variable_ops.ResourceVariable(
File "C:UsersIuriAndreazzaAppDataRoamingPythonPython38site-packagestensorflowpythonopsvariables.py", line 264, in __call__
return super(VariableMetaclass, cls).__call__(*args, **kwargs)
File "C:UsersIuriAndreazzaAppDataRoamingPythonPython38site-packagestensorflowpythonopsresource_variable_ops.py", line 1507, in __init__
self._init_from_args(
File "C:UsersIuriAndreazzaAppDataRoamingPythonPython38site-packagestensorflowpythonopsresource_variable_ops.py", line 1661, in _init_from_args
handle = eager_safe_variable_handle(
File "C:UsersIuriAndreazzaAppDataRoamingPythonPython38site-packagestensorflowpythonopsresource_variable_ops.py", line 242, in eager_safe_variable_handle
return _variable_handle_from_shape_and_dtype(
File "C:UsersIuriAndreazzaAppDataRoamingPythonPython38site-packagestensorflowpythonopsresource_variable_ops.py", line 174, in _variable_handle_from_shape_and_dtype
gen_logging_ops._assert( # pylint: disable=protected-access
File "C:UsersIuriAndreazzaAppDataRoamingPythonPython38site-packagestensorflowpythonopsgen_logging_ops.py", line 49, in _assert
_ops.raise_from_not_ok_status(e, name)
File "C:UsersIuriAndreazzaAppDataRoamingPythonPython38site-packagestensorflowpythonframeworkops.py", line 6843, in raise_from_not_ok_status
six.raise_from(core._status_to_exception(e.code, message), None)
File "<string>", line 3, in raise_from
tensorflow.python.framework.errors_impl.InvalidArgumentError: assertion failed: [0] [Op:Assert] name: EagerVariableNameReuse
*REMOVED TO REDUCE SIZE OF THE MESSAGE*
----------------------------------------------------------------------
Ran 20 tests in 1.615s
FAILED (errors=11, skipped=1)
有人面临类似的问题吗?
谢谢!
我在colab中遵循了相同的教程,没有遇到任何问题。这是我的可乐。
您可能需要安装依赖项和proto。
试试这些:
cd models/research/
protoc object_detection/protos/*.proto --python_out=.
cd models/research
pip install .
你可能会发现有用的其他资源:
- 官方文档-带有TensorFlow 2的API对象检测
- TF2对象检测API-对自定义数据进行微调预训练模型