在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称(OpenSource Name):wilile26811249/MobileViT开源软件地址(OpenSource Url):https://github.com/wilile26811249/MobileViT开源编程语言(OpenSource Language):Python 100.0%开源软件介绍(OpenSource Introduction):MobileViTUnofficial PyTorch implementation of MobileViT based on paper MOBILEVIT: LIGHT-WEIGHT, GENERAL-PURPOSE, AND MOBILE-FRIENDLY VISION TRANSFORMER. Table of ContentsModel Architecture MobileViT ArchitectureUsage
Training
ExperimentweightMobileVit-S Pretrained Weights:weightMobileVit-XXS Pretrained Weights:How to load pretrained weight(training with DataParrael)Solution by the @Sehaba95: def load_mobilevit_weights(model_path):
# Create an instance of the MobileViT model
net = MobileViT_S()
# Load the PyTorch state_dict
state_dict = torch.load(model_path, map_location=torch.device('cpu'))['state_dict']
# Since there is a problem in the names of layers, we will change the keys to meet the MobileViT model architecture
for key in list(state_dict.keys()):
state_dict[key.replace('module.', '')] = state_dict.pop(key)
# Once the keys are fixed, we can modify the parameters of MobileViT
net.load_state_dict(state_dict)
return net
net = load_mobilevit_weights("MobileViT_S_model_best.pth.tar")
Citation
If this implement have any problem please let me know, thank you. |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论