You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If you don't want to compare the ouput error between the MegEngine implementation and PyTorch one, just ignore requirements.txt and install MegEngine from the command line:
Convert trained weights from torch to megengine, the converted weights will be saved in ./pretained/ , you need to specify the convert model architecture and path to checkpoint offered by official repo.
By default, the compare script will convert the torch state_dict to the format that megengine need.
If you want to compare the error by checkpoints, you neet load them manually.
Load From Hub
Import from megengine.hub:
Way 1:
frommegengineimporthubmodelhub=hub.import_module(
repo_info='asthestarsfalll/BiSeNet-MegEngine:main', git_host='github.com')
# custom you own BiSeNetbisenet=modelhub.BiSeNetV1(n_classes=150)
# load pretrained modelpretrained_model=modelhub.bisenetv1(pretrained=True)
Way 2:
frommegengineimporthub# load pretrained model model_name='bisenetv1'pretrained_model=hub.load(
repo_info='asthestarsfalll/BiSeNet-MegEngine:main', entry=model_name, git_host='github.com', pretrained=True)
For those models which do not have pretrained model online, you need to convert weights mannaly, and load the model without pretrained weights like this: