yxgeee / MMT

[ICLR-2020] Mutual Mean-Teaching: Pseudo Label Refinery for Unsupervised Domain Adaptation on Person Re-identification.
https://yxgeee.github.io/projects/mmt
MIT License
472 stars 73 forks source link

question about "delete anything about model_2 and model_2_ema" #30

Closed ITdoubleseven closed 4 years ago

ITdoubleseven commented 4 years ago

when I tried to delete anything about model_2 and model_2_ema,errors occurred: Traceback (most recent call last): File "examples/mmt_train_kmeans.py", line 287, in main() File "examples/mmt_train_kmeans.py", line 132, in main main_worker(args) File "examples/mmt_train_kmeans.py", line 201, in main_worker trainer = MMTTrainer(model_1, model_1_ema, num_cluster=args.num_clusters, alpha=args.alpha) TypeError: init() missing 2 required positional arguments: 'model_1_ema' and 'model_2_ema'

the following is MMTTrainer: class MMTTrainer(object): def init(self, model_1, model_1_ema, num_cluster=500, alpha=0.999): super(MMTTrainer, self).init() self.model_1 = model_1

self.model_2 = model_2

    self.num_cluster = num_cluster

    self.model_1_ema = model_1_ema
    #self.model_2_ema = model_2_ema

BUT,it is very strange that "MMTTrainer" do not contain the parameters" model_2_ema and model_2".

yxgeee commented 4 years ago

Run setup command python setup.py install once changing the code in mmt/

ITdoubleseven commented 4 years ago

Thank you very much.I solved this problem.