hub icon indicating copy to clipboard operation
hub copied to clipboard

Error when running retrain

Open Jowizo opened this issue 8 years ago • 3 comments

I get the following output when I run the command: python retrain.py --image_dir hub-master\flower_photos

output:

Traceback (most recent call last):
  File "retrain.py", line 1341, in <module>
    tf.app.run(main=main, argv=[sys.argv[0]] + unparsed)
  File "C:\Users\Johar\AppData\Roaming\Python\Python35\site-packages\tensorflow\python\platform\app.py", line 126, in run
    _sys.exit(main(argv))
  File "retrain.py", line 1025, in main
    module_spec = hub.load_module_spec(FLAGS.tfhub_module)
  File "C:\Users\Johar\Anaconda2\envs\TF\lib\site-packages\tensorflow_hub\native_module.py", line 103, in load_module_spec
    module_def_proto.ParseFromString(f.read())
  File "C:\Users\Johar\AppData\Roaming\Python\Python35\site-packages\tensorflow\python\lib\io\file_io.py", line 120, in read
    self._preread_check()
  File "C:\Users\Johar\AppData\Roaming\Python\Python35\site-packages\tensorflow\python\lib\io\file_io.py", line 80, in _preread_check
    compat.as_bytes(self.__name), 1024 * 512, status)
  File "C:\Users\Johar\AppData\Roaming\Python\Python35\site-packages\tensorflow\python\framework\errors_impl.py", line 519, in __exit__
    c_api.TF_GetCode(self.status.status))
tensorflow.python.framework.errors_impl.NotFoundError: NewRandomAccessFile failed to Create/Open: C:\Users\Johar\AppData\Local\Temp\tfhub_modules\11d9faf945d073033780fd924b2b09ff42155763\tfhub_module.pb : The system cannot find the file specified.
; No such file or directory

I'm running windows 10, python 3.5.5 , TF 1.8.0

About an hour ago it was working fine then I tried using profiling and it stopped working

Jowizo avatar May 29 '18 14:05 Jowizo

Hi, Did you solve your problem? I got the same...

ViktorijaV avatar Jun 13 '18 09:06 ViktorijaV

I had the same problem as well. To help anyone who comes across this by searching, a solution:

Delete the tfhub_modules folder and it's contents. In the trace back above this would be: C:\Users\Johar\AppData\Local\Tmp\tfhub_modules Other systems may vary. For my setup it was: /var/folders/cc/0dttrmf90g777cws2m3sfvvr0000gp/T/tfhub_modules

Then rerun retrain.py

It will redownload the trained network and should then work.

adocilesloth avatar Jun 26 '18 08:06 adocilesloth

I had a similar issue where it would refuse to delete log data from the /tmp/retrains_logs folder which was being caused by tensorboard keeping the events.out.tfevents files locked in memory. Closing the tensorboard process fixed this issue.

roboticlemon avatar May 30 '19 06:05 roboticlemon