xiaolai-sqlai / mobilenetv3

mobilenetv3 with pytorch,provide pre-train model
MIT License
1.6k stars 340 forks source link

fail to load pre-model #29

Open mk123qwe opened 4 years ago

mk123qwe commented 4 years ago
    model = torch.load(‘mbv3_small.pth.tar‘, map_location='cpu') 
    print('Loading base network...')
    weight = model["state_dict"]
    base_net = torch.nn.DataParallel(base_net)
    base_net.load_state_dict(weights)

The program has been running, no response

Buster-maker commented 4 years ago

you can try it

model = torch.load('./mbv3_small.pth', map_location = 'cpu')
    print('Loading base network...')
    weight = model["state_dict"]
    base_net = torch.nn.DataParallel(net)
    base_net.load_state_dict(weight)
    y = net(x)
    end = time.time()
    print('Running time: %s Seconds' % (end - start))
    print(y.size())