加载微调的EfficientDet模型时出错

时间:2020-06-03 08:25:24

标签: python windows tensorflow machine-learning deep-learning

我想使用this repo.,这就是我在Google Colab中训练模型的方式。

!python main.py --mode=train
--training_file_pattern=tfrecord/{file_pattern}
--validation_file_pattern=tfrecord/{file_pattern}
--val_json_file=tfrecord/json_pascal.json
--model_name={MODEL}
--model_dir=model_dir/{MODEL}-finetune
--ckpt={MODEL}
--train_batch_size=8
--eval_batch_size=8 --eval_samples={images_per_epoch}
--num_examples_per_epoch={images_per_epoch} --num_epochs=12
--hparams="num_classes=4,moving_average_decay=0"
--use_tpu=False

11小时后(Colab在12小时后结束会话),我下载了检查点并尝试使用它们。 (如您所见,我是Windows用户)。 Windows支持Model/savedmodel格式。但我在下面看到此错误。我应该如何使用这些检查点来构建模型?

checkpoint

python model_inspect.py --runmode=saved_model --model_name=efficientdet-d1 --ckpt_path=Model/ --saved_model_dir=Model/savedmodel
2020-06-02 22:43:16.925482: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library cudart64_100.dll
2020-06-02 22:44:01.176435: I tensorflow/core/platform/cpu_feature_guard.cc:142] Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX2
2020-06-02 22:44:01.323450: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library nvcuda.dll
2020-06-02 22:44:02.066774: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1618] Found device 0 with properties:
name: GeForce 820M major: 2 minor: 1 memoryClockRate(GHz): 1.25
pciBusID: 0000:08:00.0
2020-06-02 22:44:02.077396: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library cudart64_100.dll
2020-06-02 22:44:02.236795: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library cublas64_100.dll
2020-06-02 22:44:02.397136: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library cufft64_100.dll
2020-06-02 22:44:02.464727: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library curand64_100.dll
2020-06-02 22:44:02.646512: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library cusolver64_100.dll
2020-06-02 22:44:02.772696: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library cusparse64_100.dll
2020-06-02 22:44:02.794250: W tensorflow/stream_executor/platform/default/dso_loader.cc:55] Could not load dynamic library 'cudnn64_7.dll'; dlerror: cudnn64_7.dll not found
2020-06-02 22:44:02.811955: W tensorflow/core/common_runtime/gpu/gpu_device.cc:1641] Cannot dlopen some GPU libraries. Please make sure the missing libraries mentioned above are installed properly if you would like to use GPU. Follow the guide at https://www.tensorflow.org/install/gpu for how to download and setup the required libraries for your platform.
Skipping registering GPU devices...
2020-06-02 22:44:03.065205: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1159] Device interconnect StreamExecutor with strength 1 edge matrix:
2020-06-02 22:44:03.086319: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1165] 0
2020-06-02 22:44:03.095067: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1178] 0: N
W0602 22:44:05.333684 23472 deprecation.py:506] From C:\Program Files\Python37\lib\site-packages\tensorflow_core\python\ops\resource_variable_ops.py:1630: calling BaseResourceVariable.init (from tensorflow.python.ops.resource_variable_ops) with constraint is deprecated and will be removed in a future version.
Instructions for updating:
If using Keras pass *_constraint arguments to layers.
W0602 22:44:11.606334 23472 deprecation.py:323] From C:\Program Files\Python37\lib\site-packages\tensorflow_core\python\profiler\internal\flops_registry.py:142: tensor_shape_from_node_def_name (from tensorflow.python.framework.graph_util_impl) is deprecated and will be removed in a future version.
Instructions for updating:
Use tf.compat.v1.graph_util.tensor_shape_from_node_def_name
3 ops no flops stats due to incomplete shapes.
Parsing Inputs...
Incomplete shape.
Incomplete shape.
W0602 22:44:12.219369 23472 deprecation.py:323] From D:\vehicle detection and counting\efficientdet\efficientdet_arch.py:138: conv2d (from tensorflow.python.layers.convolutional) is deprecated and will be removed in a future version.
Instructions for updating:
Use tf.keras.layers.Conv2D instead.
W0602 22:44:12.219369 23472 deprecation.py:323] From C:\Program Files\Python37\lib\site-packages\tensorflow_core\python\layers\convolutional.py:424: Layer.apply (from tensorflow.python.keras.engine.base_layer) is deprecated and will be removed in a future version.
Instructions for updating:
Please use layer.call method instead.
W0602 22:44:12.266263 23472 deprecation.py:323] From D:\vehicle detection and counting\efficientdet\efficientdet_arch.py:164: max_pooling2d (from tensorflow.python.layers.pooling) is deprecated and will be removed in a future version.
Instructions for updating:
Use keras.layers.MaxPooling2D instead.
W0602 22:44:12.304071 23472 deprecation.py:323] From D:\vehicle detection and counting\efficientdet\efficientdet_arch.py:682: separable_conv2d (from tensorflow.python.layers.convolutional) is deprecated and will be removed in a future version.
Instructions for updating:
Use tf.keras.layers.SeparableConv2D instead.
3 ops no flops stats due to incomplete shapes.
Parsing Inputs...
Incomplete shape.
Incomplete shape.
3 ops no flops stats due to incomplete shapes.
Parsing Inputs...
Incomplete shape.
Incomplete shape.
E0602 22:44:21.230890 23472 checkpoint_management.py:346] Couldn't match files for checkpoint Model/model.ckpt-951
W0602 22:44:21.246498 23472 deprecation.py:323] From C:\Program Files\Python37\lib\site-packages\tensorflow_core\python\training\moving_averages.py:433: Variable.initialized_value (from tensorflow.python.ops.variables) is deprecated and will be removed in a future version.
Instructions for updating:
Use Variable.read_value. Variables in 2.X are initialized automatically both in eager and graph (inside tf.defun) contexts.
Traceback (most recent call last):
File "model_inspect.py", line 492, in
app.run(main)
File "C:\Program Files\Python37\lib\site-packages\absl\app.py", line 300, in run
_run_main(main, args)
File "C:\Program Files\Python37\lib\site-packages\absl\app.py", line 251, in _run_main
sys.exit(main(argv))
File "model_inspect.py", line 486, in main
trace_filename=FLAGS.trace_filename)
File "model_inspect.py", line 439, in run_model
self.export_saved_model(**config_dict)
File "model_inspect.py", line 148, in export_saved_model
driver.build()
File "D:\vehicle detection and counting\efficientdet\inference.py", line 574, in build
export_ckpt=None)
File "D:\vehicle detection and counting\efficientdet\inference.py", line 204, in restore_ckpt
saver.restore(sess, ckpt_path)
File "C:\Program Files\Python37\lib\site-packages\tensorflow_core\python\training\saver.py", line 1277, in restore
raise ValueError("Can't load save_path when it is None.")
ValueError: Can't load save_path when it is None.

0 个答案:

没有答案