Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

save weights error #12

Closed
NJUFlipped opened this issue Jun 3, 2018 · 6 comments
Closed

save weights error #12

NJUFlipped opened this issue Jun 3, 2018 · 6 comments

Comments

@NJUFlipped
Copy link

Traceback (most recent call last):
File "train.py", line 108, in
model.save_weights('%s/%d.weights' % (opt.checkpoint_dir, epoch))
File "F:\cmp\VehicleDetection\PyTorch-YOLOv3\models.py", line 306, in save_weights
self.header_info[3] = self.seen
File "D:\software\Anaconda3\lib\site-packages\torch\nn\modules\module.py", line 532, in getattr
type(self).name, name))
AttributeError: 'Darknet' object has no attribute 'seen'

@DeokyunKim
Copy link

I have same error.

@nationalflag
Copy link

You should load a pretrained weights such as yolov3.weights first in train.py.

@DeokyunKim
Copy link

@nationalflag Could you write the code ? I didnt understand. thanks !

@nationalflag
Copy link

model = Darknet(opt.model_config_path)
model.apply(weights_init_normal)
model.load_weights(opt.weights_path)

Darknet.seen is assigned in load_weights

@eriklindernoren
Copy link
Owner

Hi, this is fixed in 6727086. You don't have to load pretrained weights to be able to save the weights of the model during training with this commit.

@poornimajd
Copy link

Hey can the save darknet weights function in models.py be used to save the weights in pytorch format ,i.e with the extension .pt ,or how is that function used?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants