mahmoodlab / HEST

HEST: Bringing Spatial Transcriptomics and Histopathology together - NeurIPS 2024 (Spotlight)
Other
169 stars 12 forks source link

Import Error: ModuleNotFoundError for vision_transformer_latest #31

Closed oyjr closed 3 months ago

oyjr commented 3 months ago

When trying to run the predict_expression.py script, I encountered an import error. The error suggests that the module vision_transformer_latest is missing, but I can't find this file in the project directory. Are there any additional setup steps or dependencies I might have missed? Thank you for your help in resolving this issue.

oyjr commented 3 months ago

`Traceback (most recent call last):

File "[...]/src/hest/bench/training/predict_expression.py", line 23, in from hest.bench.cpath_model_zoo.builder import get_encoder

File "[...]/src/hest/bench/init.py", line 2, in from .training.predict_expression import benchmark_encoder

File "[...]/src/hest/bench/training/predict_expression.py", line 23, in from hest.bench.cpath_model_zoo.builder import get_encoder

File "[...]/src/hest/bench/cpath_model_zoo/init.py", line 1, in from .models import *

File "[...]/src/hest/bench/cpath_model_zoo/models/init.py", line 1, in from .vision_transformer_latest import *

ModuleNotFoundError: No module named 'hest.bench.cpath_model_zoo.models.vision_transformer_latest'`

pauldoucet commented 3 months ago

Good morning, sorry for the inconvenience. We just pushed a fix, can you pull the new update please?

Let me know how it goes

oyjr commented 3 months ago

Thank you for the quick fix! I've pulled the new update, and it has resolved the initial import error. I found that I needed to remove two more import statements to get everything working:

In [...]/src/hest/bench/cpath_model_zoo/models/custom_weight_loaders.py, line 6: from .vision_transformer_latest import resize_pos_embed In [...]/src/hest/bench/cpath_model_zoo/builder.py, line 2: from .models.vision_transformer_custom import vit_large_w_pooler

After removing these two imports, the script ran successfully. Thank you!!

pauldoucet commented 3 months ago

Thanks for the feedback!

We're currently working on a complete cleanup of the benchmark and the addition of a couple new models too. I will create a pull request today,

Best,

Paul