Pytorch0.4.1_Openpose icon indicating copy to clipboard operation
Pytorch0.4.1_Openpose copied to clipboard

train problem

Open JiangDing1995 opened this issue 5 years ago • 2 comments

When i run 'python train.py' to 50%, here is the error: loading annotations into memory... Done (t=4.52s) creating index... index created! loading annotations into memory... Done (t=0.53s) creating index... index created! train images: 64115 val images: 2693 50%|████████████████▉ | 8014/16029 [3:14:17<3:02:36, 1.37s/it]Traceback (most recent call last): File "train.py", line 16, in openpose.train() File "/home/robeon/Pytorch0.4.1_Openpose-master/openpose.py", line 283, in train self.save_state(val_loss) File "/home/robeon/Pytorch0.4.1_Openpose-master/openpose.py", line 101, in save_state ('model_{}_val_loss:{}_step:{}.pth'.format(time, val_loss, self.step))) File "/home/robeon/anaconda3/lib/python3.6/site-packages/torch/serialization.py", line 224, in save return _with_file_like(f, "wb", lambda f: _save(obj, f, pickle_module, pickle_protocol)) File "/home/robeon/anaconda3/lib/python3.6/site-packages/torch/serialization.py", line 147, in _with_file_like f = open(f, mode) FileNotFoundError: [Errno 2] No such file or directory: 'work_space/save/model_2019-11-12-12-39_val_loss:0.022055972758680584_step:8014.pth'

before 50% is ok,but why need this '.pth' file? anyone help?

JiangDing1995 avatar Nov 12 '19 06:11 JiangDing1995

I have the same problem! anyone help?

Johnren1111 avatar Feb 10 '20 07:02 Johnren1111

@JiangDing1995 @Johnren1111

  1. create a new file named "model" in work_space,
  2. modify all code about file path, such as:

params['work_space']/'save' ->

os.path.join(params['work_space'],'save')

save_path / ('model_{}_val_loss:{}_step:{}.pth'.format(time, val_loss, self.step) ->

os.path.join(save_path,'model_{}val_loss{}step{}.pth'.format(time, val_loss, self.step)

WinstonDeng avatar Sep 10 '20 11:09 WinstonDeng