thtrieu / darkflow

Translate darknet to tensorflow. Load trained weights, retrain/fine-tune using tensorflow, export constant graph def to mobile devices
GNU General Public License v3.0
6.13k stars 2.08k forks source link

OSError: raw write() returned invalid length. This error stop the training #565

Open nobleboyh opened 6 years ago

nobleboyh commented 6 years ago

I have this problem when i train the model :( It stops at different steps with this error. I'm using python 3.5.0 in windows 10 pro version 1709. Thanks in advance !


step 354 - loss 11.223640441894531 - moving ave loss 12.112710279106556
Traceback (most recent call last):
  File "flow", line 6, in <module>
    cliHandler(sys.argv)
  File "C:\Users\hoang\Desktop\YOLO\darkflow-master\darkflow-master\darkflow\cli.py", line 33, in cliHandler
    print('Enter training ...'); tfnet.train()
  File "C:\Users\hoang\Desktop\YOLO\darkflow-master\darkflow-master\darkflow\net\flow.py", line 67, in train
    self.say(form.format(step_now, loss, loss_mva))
  File "C:\Users\hoang\Desktop\YOLO\darkflow-master\darkflow-master\darkflow\net\help.py", line 42, in say
    print(msg)
OSError: raw write() returned invalid length 146 (should have been between 0 and 73)
simonfranz commented 6 years ago

Seeh here this helped me: https://stackoverflow.com/a/47889702/490647

first install the package pip installl win_unicode_console

then add into your code

import win_unicode_console
win_unicode_console.enable()
nobleboyh commented 6 years ago

@simonfranz thank you but it doesn't work :(

i open my cmd then

python
import win_unicode_console
win_unicode_console.enable()

after that, i use this command to train my model:

flow --model new_model_guinea_pig/tiny-yolo-voc-1c.cfg --load new_model_guinea_pig/tiny-yolo-voc.weights --train --annotation new_model_guinea_pig/xml_gp/ --dataset new_model_guinea_pig/guinea_pig/ --gpu 0.0 --epoch 10

but it returns this:

File "<stdin>", line 1
    flow --model new_model_guinea_pig/tiny-yolo-voc-1c.cfg --load new_model_guinea_pig/tiny-yolo-voc.weights --train --annotation new_model_guinea_pig/xml_gp/ --dataset new_model_guinea_pig/guinea_pig/ --gpu 0.0 --epoch 10
                                    ^
SyntaxError: invalid syntax