automl icon indicating copy to clipboard operation
automl copied to clipboard

Error while using another EfficientDet version.

Open uysalmustafa opened this issue 6 years ago • 6 comments

Hi, I've downloaded the repo to my local PC. I've used d0, it is really great, thanks for your work. Then, I wanted to improve accuracy. I've tried to use d2. And I've seen the error message below. Also, I should say that I run the repo via runy.py It consists of 3 lines which are:

import Count
d = Count.Vehicle_counting(model_name='Model/efficientdet-d2',saved_dir='savedmodel')
d.Counting(video_path='input.mp4',output_path='output/out.mp4',skip_frames=15,confidence_tresh=0.60)

I see this error message on second line:

Traceback (most recent call last):
  File "runy.py", line 2, in <module>
    d = Count.Vehicle_counting(model_name='Model/efficientdet-d2',saved_dir='sav
edmodel')
  File "C:\Users\mustafa\Downloads\FinalProject\FinalProject\Count.py", line 34,
 in __init__
    self.driver.load(self.saved_dir)
  File "C:\Users\mustafa\Downloads\FinalProject\FinalProject\inference.py", line
 38, in load
    saved_model_dir_)
  File "C:\Users\mustafa\anaconda3\lib\site-packages\tensorflow_core\python\util
\deprecation.py", line 324, in new_func
    return func(*args, **kwargs)
  File "C:\Users\mustafa\anaconda3\lib\site-packages\tensorflow_core\python\save
d_model\loader_impl.py", line 269, in load
    return loader.load(sess, tags, import_scope, **saver_kwargs)
  File "C:\Users\mustafa\anaconda3\lib\site-packages\tensorflow_core\python\save
d_model\loader_impl.py", line 423, in load
    self.restore_variables(sess, saver, import_scope)
  File "C:\Users\mustafa\anaconda3\lib\site-packages\tensorflow_core\python\save
d_model\loader_impl.py", line 377, in restore_variables
    saver.restore(sess, self._variables_path)
  File "C:\Users\mustafa\anaconda3\lib\site-packages\tensorflow_core\python\trai
ning\saver.py", line 1290, in restore
    {self.saver_def.filename_tensor_name: save_path})
  File "C:\Users\mustafa\anaconda3\lib\site-packages\tensorflow_core\python\clie
nt\session.py", line 960, in run
    run_metadata_ptr)
  File "C:\Users\mustafa\anaconda3\lib\site-packages\tensorflow_core\python\clie
nt\session.py", line 1183, in _run
    feed_dict_tensor, options, run_metadata)
  File "C:\Users\mustafa\anaconda3\lib\site-packages\tensorflow_core\python\clie
nt\session.py", line 1361, in _do_run
    run_metadata)
  File "C:\Users\mustafa\anaconda3\lib\site-packages\tensorflow_core\python\clie
nt\session.py", line 1386, in _do_call
    raise type(e)(node_def, op, message)
tensorflow.python.framework.errors_impl.DataLossError: Checksum does not match:
stored 887928165 vs. calculated on the restored bytes 3136450994
         [[node save_1/RestoreV2 (defined at C:\Users\mustafa\Downloads\FinalPro
ject\FinalProject\inference.py:38) ]]

Original stack trace for 'save_1/RestoreV2':
  File "runy.py", line 2, in <module>
    d = Count.Vehicle_counting(model_name='Model/efficientdet-d2',saved_dir='sav
edmodel')
  File "C:\Users\mustafa\Downloads\FinalProject\FinalProject\Count.py", line 34,
 in __init__
    self.driver.load(self.saved_dir)
  File "C:\Users\mustafa\Downloads\FinalProject\FinalProject\inference.py", line
 38, in load
    saved_model_dir_)
  File "C:\Users\mustafa\anaconda3\lib\site-packages\tensorflow_core\python\util
\deprecation.py", line 324, in new_func
    return func(*args, **kwargs)
  File "C:\Users\mustafa\anaconda3\lib\site-packages\tensorflow_core\python\save
d_model\loader_impl.py", line 269, in load
    return loader.load(sess, tags, import_scope, **saver_kwargs)
  File "C:\Users\mustafa\anaconda3\lib\site-packages\tensorflow_core\python\save
d_model\loader_impl.py", line 422, in load
    **saver_kwargs)
  File "C:\Users\mustafa\anaconda3\lib\site-packages\tensorflow_core\python\save
d_model\loader_impl.py", line 352, in load_graph
    meta_graph_def, import_scope=import_scope, **saver_kwargs)
  File "C:\Users\mustafa\anaconda3\lib\site-packages\tensorflow_core\python\trai
ning\saver.py", line 1477, in _import_meta_graph_with_return_elements
    **kwargs))
  File "C:\Users\mustafa\anaconda3\lib\site-packages\tensorflow_core\python\fram
ework\meta_graph.py", line 797, in import_scoped_meta_graph_with_return_elements

    return_elements=return_elements)
  File "C:\Users\mustafa\anaconda3\lib\site-packages\tensorflow_core\python\util
\deprecation.py", line 507, in new_func
    return func(*args, **kwargs)
  File "C:\Users\mustafa\anaconda3\lib\site-packages\tensorflow_core\python\fram
ework\importer.py", line 405, in import_graph_def
    producer_op_list=producer_op_list)
  File "C:\Users\mustafa\anaconda3\lib\site-packages\tensorflow_core\python\fram
ework\importer.py", line 513, in _import_graph_def_internal
    _ProcessNewOps(graph)
  File "C:\Users\mustafa\anaconda3\lib\site-packages\tensorflow_core\python\fram
ework\importer.py", line 243, in _ProcessNewOps
    for new_op in graph._add_new_tf_operations(compute_devices=False):  # pylint
: disable=protected-access
  File "C:\Users\mustafa\anaconda3\lib\site-packages\tensorflow_core\python\fram
ework\ops.py", line 3459, in _add_new_tf_operations
    for c_op in c_api_util.new_tf_operations(self)
  File "C:\Users\mustafa\anaconda3\lib\site-packages\tensorflow_core\python\fram
ework\ops.py", line 3459, in <listcomp>
    for c_op in c_api_util.new_tf_operations(self)
  File "C:\Users\mustafa\anaconda3\lib\site-packages\tensorflow_core\python\fram
ework\ops.py", line 3347, in _create_op_from_tf_operation
    ret = Operation(c_op, self)
  File "C:\Users\mustafa\anaconda3\lib\site-packages\tensorflow_core\python\fram
ework\ops.py", line 1756, in __init__
    self._traceback = tf_stack.extract_stack()

I am sure that I don't use same model

Untitled

and I tried this but I've seen this error:

model = tf.saved_model.load(YOUR_PATH_TO_SAVEMODEL)
infer = model.signatures[tf.saved_model.DEFAULT_SERVING_SIGNATURE_DEF_KEY]
print(infer.structured_outputs)

Untitled2

What is the reason? How can I fix this issue?

uysalmustafa avatar May 18 '20 21:05 uysalmustafa

Can you try the following :

model = tf.saved_model.load(YOUR_PATH_TO_SAVEMODEL)
infer = model.signatures[tf.saved_model.DEFAULT_SERVING_SIGNATURE_DEF_KEY]
print(infer.structured_outputs)

and see if this work.

jcburnel avatar May 19 '20 11:05 jcburnel

Hi @MustafaUysal160207077 Since d0 works but d2 failed, it is most likely that you reuse the same saved_model folder for both of them. You may want to use different saved_model folder.

mingxingtan avatar May 21 '20 17:05 mingxingtan

Can you try the following :

model = tf.saved_model.load(YOUR_PATH_TO_SAVEMODEL)
infer = model.signatures[tf.saved_model.DEFAULT_SERVING_SIGNATURE_DEF_KEY]
print(infer.structured_outputs)

and see if this work.

I've tried but didn't work I updated the post to show error message.

uysalmustafa avatar May 21 '20 20:05 uysalmustafa

Hi @MustafaUysal160207077 Since d0 works but d2 failed, it is most likely that you reuse the same saved_model folder for both of them. You may want to use different saved_model folder.

I am sure that I don't. I updated the post.

uysalmustafa avatar May 21 '20 20:05 uysalmustafa

Hmm, interesting. Looks like this is a potential TF problem, see this discussion: https://stackoverflow.com/questions/43116713/tensorflow-datalosserror-checksum-does-not-match-when-used-with-supervisor

someone says you can delete the latest checkpoint and retry. Do you want to give it a try?

mingxingtan avatar May 21 '20 23:05 mingxingtan

Untitled

Hmm, interesting. Looks like this is a potential TF problem, see this discussion: https://stackoverflow.com/questions/43116713/tensorflow-datalosserror-checksum-does-not-match-when-used-with-supervisor

someone says you can delete the latest checkpoint and retry. Do you want to give it a try?

Untitled

I couldn't see checkpoint file. Where it can be?

uysalmustafa avatar May 22 '20 21:05 uysalmustafa