PyTorch - gkgkgk1215/else GitHub Wiki

TypeError: expected np.ndarray (got numpy.ndarray)

  • downgrade numpy: pip uninstall numpy (twice)
  • install numpy: pip install numpy==1.26.0
  • check the version of torch & torchvision: torch==2.4.1, torchvision==0.19.1

*** AttributeError: 'BatchNorm2d' object has no attribute 'track_running_stats'

  • when running the line, "encoder, decoder = torch.load('./model/conv_autoencoder.pkl')"
  • Your model train by pytorch0.3.x, but run in pytorch > 0.4.0