ShengcaiLiao/TransMatcher

optimizer can only optimize Tensors, but one of the params is str

liyuke65535 opened this issue · 4 comments

作者你好!我在跑TransMatcher的时候遇到了一些问题。
由于我不能连上github,我去IBNnet的仓库找到了resnet50_ibn_b的模型下载地址。我用torch.load()来载入模型后,却发生了另一个问题:
AttributeError: 'collections.OrderedDict' object has no attribute 'parameters'. 我猜把model.base.parameters()变为model.base可能有用。但之后又报错了:TypeError: optimizer can only optimize Tensors, but one of the params is str

image
image
我像这样改了代码;另外想问问,用torch.hub.load一直处于等待阶段,有什么办法(例如github镜像源)解决呢?谢谢!

Hi, you can try modifications according to this file: https://github.com/ShengcaiLiao/QAConv/blob/f885778288481d0d926bae9710b25eb8cbe21804/reid/models/resmap_ibnb.py

In this file it seems that loading the ResNet pretrained weights is enough; no need to load a separate IBN-Net pretrained file.

Another way is to ask a friend who has access to torch.hub to initiate the XingangPan/IBN-Net cache and send the cached files to you and put them to your cache folder.

Thank U. That helps a lot!