Hi David,
Thank you heaps for your reply,
I updated my code as suggested instead of:

‘model_state_dict’: model,

to

torch.save({‘model_state_dict’: model.state_dict(),
}, os.path.join(self.checkpoint, ‘model_{}.pth’.format(task_id)))

however, I am still getting the same error:
 torch.save({'model_state_dict': model.state_dict(),
AttributeError: 'collections.OrderedDict' object has no attribute 'state_dict'

I was reading the issues also discussed here:
  
    
    
    "AttributeError: 'collections.OrderedDict' object has no attribute 'state_dict" 
  
  
    Hi, 
thank you very much. 
I tried as you told me. 
It seems both 
net.load_state_dict(torch.load(model_path)) 
and 
net.load(model_path) 
works well(inference correctly) 
but still , I don’t know how to save a whole model in the case. 
using “net.load_state_dict(torch.load(model_path))” and torch.save(net,‘mb_v1_ssd_all.pth’) 
still give en error: 
File “/home/hong/anaconda3/envs/PyTorch1.0_GPU_ONNX/lib/python3.7/site-packages/torch/serialization.py”, line 291, in _save 
pickler.dump(obj) 
Type…
  


and I tested what was suggested after the model saved and checkpoint loaded to net , I also saved another version of the modelFull by simply adding:
torch.save(net, os.path.join(self.checkpoint, ‘modelFULL_{}.pth’.format(task_id)))
After loading the model:

model.load_state_dict(torch.load(“checkpoint/modelFULL_0.pth”)

I am getting an error:
AttributeError: Net object has no attribute Copy
thank you.