Run out of input workaround and error with train_loop() (warnings.warn('genfromtxt:Empty input file:"%s"'%fname)

Asked 2 years ago, Updated 2 years ago, 52 views

Nice to meet you.I'm a python beginner.

I am currently working on this site.
"""Learn and recognize your own image set in depth with the NIN of the Chainer"""
" http://d.hatena.ne.jp/shi3z/20150709

$python train_imagenet.py-g 0-E 20000 train.txt test.txt2>&1|teelog

Now that I've done this,

Traceback (most recent call last):
  File "train_imagenet.py", line 66, in<module>
    mean_image=pickle.load(open(args.mean, 'rb')))
EOFError:Ran out of input

appears.

My environment is Python 3.5.2::Anaconda 4.2.0 (x86_64).

Thank you for your cooperation.

Add

Find this article and


cPickle.UnpicklingError on Chainer
https://qiita.com/shota_hayashi/items/4a488931ab88f45cfa55

The error content is different, but I did it

File "train_imagenet.py", line 67, in<module>
    mean_image=np.load(args.mean)
  File "~/site-packages/numpy/lib/npyio.py", line 392, in load
    fid.seek(-N,1)#back-up
IOError: [Errno22] Invalid argument

You get the error

Additional 2

Above

mean_image=np.genfromtxt('mean.npy')

I rewritten it to , and it worked somehow.However,

`~/.pyenv/versions/anaconda3-4.2.0/lib/python3.5/site-packages/numpy/lib/npyio.py:1487:UserWarning:genfromtxt:Empty input file:"mean.npy"warnings.warn('genfromxt:Empy' file%)%" input file:"%"

The error appears.(There is an error, but it is still running at the terminal.)
There seems to be a problem with train_loop() on train_imagenet.py.

Please take care of the above as well.

Additional 3

Probably solved it.

The file mean.npy generated just before this execution is 0 bytes, and I re-generated it and started running it without any errors.

Because I don't use GPU, epoch1 takes a long time (learning rate 0.01) and I'm worried, but I'm running it without any errors.
The above issues are

mean_image=np.load(open(args.mean, 'rb')))

I wrote it like this, and it passed.

Note: Thank you for moving!
Note 2: Thank you for editing! It's easier to see!

python python3 chainer

2022-09-30 11:40

1 Answers

The mean.npy file I generated just before my execution is 0 bytes, and when I re-generated it, there was no error and I started running it.


2022-09-30 11:40

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.