greentreeys / MIL-VT

51 stars 14 forks source link

Model Weights #5

Open jerofad opened 2 years ago

jerofad commented 2 years ago

Where can we find this weight you specified in the code here? It is not on the timm list of models. https://github.com/greentreeys/MIL-VT/blob/0b44e46bc02701901fc5462f19c1e2e50e5cd588/models/FinetuneVTmodels.py#L25

YuboHe commented 2 years ago

from models.MIL_VT import *

try add above code to train_APTOS_MIL-VT.py

jerofad commented 2 years ago

Yes tried that and still get the error. Stacktrace below

Traceback (most recent call last):
  File "MIL-VT/train_APTOS_MIL-VT.py", line 437, in <module>
    main()
  File "MIL-VT/train_APTOS_MIL-VT.py", line 83, in main
    model = MIL_VT_FineTune(MODEL_PATH_finetune=MODEL_PATH_finetune, base_model=base_model, 
                    num_classes=n_classes)
  File "/mnt/qb/home/berens/jfadugba97/RetinaClassification/MIL-VT/models/FinetuneVTmodels.py", line 33, in 
           MIL_VT_FineTune drop_block_rate=None,
  File "/home/berens/jfadugba97/.conda/envs/retina/lib/python3.7/site-packages/timm/models/factory.py", line 67, in 
        create_model
   raise RuntimeError('Unknown model (%s)' % model_name)
RuntimeError: Unknown model (MIL_VT_small_patch16_384)
jerofad commented 2 years ago

@YuboHe have you ran this repository successfully ?

YuboHe commented 2 years ago

Yes, I have ran it successfully without error after I added the code I mentioned above. Before that, I have the same problem as yours. @jerofad

liqiangde commented 1 year ago

hello, I had a similar error before. After adding that code, a new problem appeared. Do you know how to solve it? Traceback (most recent call last): File "train_APTOS_MIL-VT.py", line 429, in main() File "train_APTOS_MIL-VT.py", line 78, in main model = MIL_VT_FineTune(base_model, MODEL_PATH_finetune, num_classes=n_classes) File "/workspace/test/MIL-VT-main/models/FinetuneVTmodels.py", line 28, in MIL_VT_FineTune model = create_model(model_name=base_model, File "/opt/conda/envs/dual_learning/lib/python3.8/site-packages/timm/models/factory.py", line 71, in create_model model = create_fn(pretrained=pretrained, pretrained_cfg=pretrained_cfg, *kwargs) File "/workspace/test/MIL-VT-main/models/MIL_VT.py", line 216, in MIL_VT_small_patch16_512 model = MILVisionTransformer( File "/workspace/test/MIL-VT-main/models/MIL_VT.py", line 13, in init super().init(args, **kwargs) TypeError: init() got an unexpected keyword argument 'pretrained_cfg'

liqiangde commented 1 year ago

@jerofad hello, I had a similar error before. After adding that code, a new problem appeared. Do you know how to solve it? Traceback (most recent call last): File "train_APTOS_MIL-VT.py", line 429, in main() File "train_APTOS_MIL-VT.py", line 78, in main model = MIL_VT_FineTune(base_model, MODEL_PATH_finetune, num_classes=n_classes) File "/workspace/test/MIL-VT-main/models/FinetuneVTmodels.py", line 28, in MIL_VT_FineTune model = create_model(model_name=base_model, File "/opt/conda/envs/dual_learning/lib/python3.8/site-packages/timm/models/factory.py", line 71, in create_model model = create_fn(pretrained=pretrained, pretrained_cfg=pretrained_cfg, *kwargs) File "/workspace/test/MIL-VT-main/models/MIL_VT.py", line 216, in MIL_VT_small_patch16_512 model = MILVisionTransformer( File "/workspace/test/MIL-VT-main/models/MIL_VT.py", line 13, in init super().init(args, **kwargs) TypeError: init() got an unexpected keyword argument 'pretrained_cfg'