captain-pool / GSOC

Repository for Google Summer of Code 2019 https://summerofcode.withgoogle.com/projects/#4662790671826944
MIT License
68 stars 22 forks source link

RuntimeError with TFLite models #63

Open captain-pool opened 5 years ago

captain-pool commented 5 years ago

Player crashes suddenly when TFLite inference is requested instead of SavedModel inference. $ python3 player.py --file video.mp4 --tflite compressed_esrgan.tflite

Log

Traceback (most recent call last):
  File "player.py", line 208, in <module>
    player.run()
  File "player.py", line 172, in run
    self.fetch_video()
  File "player.py", line 125, in fetch_video
    video = self.video_second()
  File "player.py", line 115, in video_second
    frames = pool.map(resolution_fn, frames)
  File "/usr/lib/python3.5/multiprocessing/pool.py", line 260, in map
    return self._map_async(func, iterable, mapstar, chunksize).get()
  File "/usr/lib/python3.5/multiprocessing/pool.py", line 608, in get
    raise self._value
  File "/usr/lib/python3.5/multiprocessing/pool.py", line 119, in worker
    result = (True, func(*args, **kwds))
  File "/usr/lib/python3.5/multiprocessing/pool.py", line 44, in mapstar
    return list(map(*args))
  File "player.py", line 70, in tflite_super_resolve
    self.interpreter.invoke()
  File "/home/rick/tf2.0/env/lib/python3.5/site-packages/tensorflow/lite/python/interpreter.py", line 303, in invoke
    self._ensure_safe()
  File "/home/rick/tf2.0/env/lib/python3.5/site-packages/tensorflow/lite/python/interpreter.py", line 123, in _ensure_safe
    data access.""")
RuntimeError: There is at least 1 reference to internal data
      in the interpreter in the form of a numpy array or slice. Be sure to
      only hold the function returned from tensor() if you are using raw
      data access.
mehao commented 5 months ago

the same issue