Open zouxianghong opened 4 months ago
The python version may be not right. You can try python version 3.8 in your conda env.
Hi there! This issue is usually from using the newer version of pytorch_metric_learning from my experience; try downgrading to an older version using pip install pytorch_metric_learning==1.6.3
and see if that works?
When I tried to run the following code, one error occurred.
python training/train.py --config config/protocols/4-step.yaml --train_environment pickles/Oxford/Oxford_train_queries.pickle
Error info:
Traceback (most recent call last): File "/home/ericxhzou/Code/InCloud/training/train.py", line 44, in <module> trained_model = trainer.train() File "/home/ericxhzou/Code/InCloud/training/trainer.py", line 122, in train self.training_step(batch, positives_mask, negatives_mask) File "/home/ericxhzou/Code/InCloud/training/trainer.py", line 84, in training_step loss_place_rec, num_triplets, non_zero_triplets, embedding_norm = self.loss_fn(embeddings, positives_mask, negatives_mask) File "/home/ericxhzou/Code/InCloud/losses/pr_loss.py", line 80, in __call__ 'num_non_zero_triplets': self.loss_fn.reducer.triplets_past_filter, File "/root/.pyenv/versions/3.10.13/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1269, in __getattr__ raise AttributeError("'{}' object has no attribute '{}'".format( AttributeError: 'AvgNonZeroReducer' object has no attribute 'triplets_past_filter'