情况说明:在玩pytorch-hed项目的时候,按照GitHub源码页面所给的用法,运行了run.py,但是报错了AttributeError: 'Tensor' object has no attribute 'clip'。
解决办法(个人看法):pytorch版本太低,Tensor.clip()在低版本中叫Tensor.clamp()。我自己配置的是torch1.6.0(是源码requirements.txt的最低要求)。把项目中run.py文件的clip改成clamp之后,程序成功跑通~