BiaPyX / BiaPy

Open source Python library for building bioimage analysis pipelines
https://BiaPyX.github.io
MIT License
114 stars 28 forks source link

Wrong net architecture in 3D Classification notebook #59

Closed iarganda closed 5 months ago

iarganda commented 5 months ago

When selecting EfficientNetB0 as model, the training throws the following error:

[07:11:28.777149] Training configuration finished.
[07:11:28.786321] Date: 2024-02-05 07:11:28
[07:11:28.786428] Arguments: Namespace(config='/content/my_3d_classification.yaml', result_dir='/content/output', name='my_3d_classification', run_id=1, gpu=0, world_size=1, local_rank=-1, dist_on_itp=False, dist_url='env://', dist_backend='nccl')
[07:11:28.787806] Job: my_3d_classification_1
[07:11:28.787876] Python       : 3.10.12 (main, Nov 20 2023, 15:14:05) [GCC 11.4.0]
[07:11:28.789216] PyTorch:  2.1.0+cu121
[07:11:28.790429] Not using distributed mode
---------------------------------------------------------------------------
AssertionError                            Traceback (most recent call last)
[<ipython-input-28-a88867eca5b3>](https://vyjefdubo0j-496ff2e9c6d22116-0-colab.googleusercontent.com/outputframe.html?vrz=colab_20240201-060115_RC00_603318229#) in <cell line: 116>()
    114 
    115 # Run the code
--> 116 biapy = BiaPy(f'/content/{job_name}.yaml', result_dir=output_path, name=job_name, run_id=1, gpu=0)
    117 biapy.run_job()

1 frames
[/usr/local/lib/python3.10/dist-packages/biapy/engine/check_configuration.py](https://vyjefdubo0j-496ff2e9c6d22116-0-colab.googleusercontent.com/outputframe.html?vrz=colab_20240201-060115_RC00_603318229#) in check_configuration(cfg, jobname, check_data_paths)
    506     ### Model ###
    507     if cfg.MODEL.SOURCE == "biapy":
--> 508         assert model_arch in ['unet', 'resunet', 'resunet++', 'attention_unet', 'multiresunet', 'seunet', 'simple_cnn', 'efficientnet_b0', 
    509             'efficientnet_b1', 'efficientnet_b2', 'efficientnet_b3', 'efficientnet_b4','efficientnet_b5','efficientnet_b6','efficientnet_b7',
    510             'unetr', 'edsr', 'rcan', 'dfcan', 'wdsr', 'vit', 'mae'],\

AssertionError: MODEL.ARCHITECTURE not in ['unet', 'resunet', 'resunet++', 'attention_unet', 'multiresunet', 'seunet', 'simple_cnn', 'efficientnet_b[0-7]', 'unetr', 'edsr', 'rcan', 'dfcan', 'wdsr', 'vit', 'mae']
danifranco commented 5 months ago

Which name did you use? Notice that it's efficientnet_b0 and not EfficientNetB0. Once you use it with that name it leads to an error loading TorchVision weights as discussed here. Will try to implement the temporal solution they propose there.

iarganda commented 5 months ago

OK, I will change, it was written as EfficientNetB0