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

ptype = dest_src['{}.{}'.format(list_key[-2], list_key[-1])] KeyError: 'bn.num_batches_tracked' #108

Open
pursu opened this issue Nov 30, 2018 · 1 comment

Comments

@pursu
Copy link

pursu commented Nov 30, 2018

Today, I first get this code. I want to train the yolov2 at the VOC2007 dataset. Then, I get this errror.

$ python train.py voc_2007_trainval gt roidb loaded from /home/lab603/pythonproject/yolo2-pytorch-master/data/cache/voc_2007_trainval_gt_roidb.pkl
load data succ...
('0-convolutional/kernel:0', torch.Size([32, 3, 3, 3]), (3, 3, 3, 32))
('0-convolutional/gamma:0', torch.Size([32]), (32,))
('0-convolutional/biases:0', torch.Size([32]), (32,))
('0-convolutional/moving_mean:0', torch.Size([32]), (32,))
('0-convolutional/moving_variance:0', torch.Size([32]), (32,))
Traceback (most recent call last):
File "train.py", line 33, in
net.load_from_npz(cfg.pretrained_model, num_conv=18)
File "/home/lab603/pythonproject/yolo2-pytorch-master/darknet.py", line 289, in load_from_npz
ptype = dest_src['{}.{}'.format(list_key[-2], list_key[-1])]
KeyError: 'bn.num_batches_tracked'

So please. How can I solve it.

@hirokatsukataoka16
Copy link

In my case, it works when I installed pytorch 0.4.0, but 0.4.1 or higher version is not.
You can install lower version as follow.

$ conda install pytorch=0.4.0 cuda90 -c pytorch
https://pytorch.org/get-started/previous-versions/

This is the example in pytorch 0.4.0 and cuda 9.0. Please install your own version.

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

2 participants