AttributeError: module ‘torch‘ has no attribute ‘Assert‘

今天在运行TransGAN的时候出现了下面的错误:

  File "train_derived.py", line 6, in <module>
    import models_search
  File "/data/tianhao.lu/code/TransGAN/models_search/__init__.py", line 1, in <module>
    from models_search import ViT_custom_local544444_256_rp, ViT_scale3_local_new_rp, diff_aug, ada, ViT_helper, ViT_custom
  File "/data/tianhao.lu/code/TransGAN/models_search/ViT_custom_local544444_256_rp.py", line 6, in <module>
    from models_search.diff_aug import DiffAugment
  File "/data/tianhao.lu/code/TransGAN/models_search/diff_aug.py", line 11, in <module>
    from torch_utils import misc
  File "/data/tianhao.lu/code/TransGAN/torch_utils/misc.py", line 64, in <module>
    symbolic_assert = torch.Assert # 1.7.0
AttributeError: module 'torch' has no attribute 'Assert'

解决方法

pip install torch==1.7.1

你可能感兴趣的:(pytorch)