When attempting to reuse the factory.py module by importing it, Python fails to import other modules such as src.datasets and src.networks. This can be solved by just using a relative import path.
This change now allows me to perform imports such as :
from libs.generalized_contrastive_loss.src import factory
backbone = factory.get_backbone("resnet18")
with the gcl repository in the libs folder.
I have checked (as far as I can tell) that this doesn't impact the extract_predictions.py, train.py or apply_pca.py scripts.
When attempting to reuse the
factory.py
module by importing it, Python fails to import other modules such assrc.datasets
andsrc.networks
. This can be solved by just using a relative import path.This change now allows me to perform imports such as :
with the gcl repository in the
libs
folder.I have checked (as far as I can tell) that this doesn't impact the
extract_predictions.py
,train.py
orapply_pca.py
scripts.