Error "ImportError: cannot import name 'ViTModel'"
Hi,
With PyTorch 1.0.0 and transformer (from 3.8 to 4.18), for running sample inference, we always have the problem:
ImportError: cannot import name 'ViTModel'.
The provided environment seems errorous for deployment.
It seems that the pretrained model is obtained from a very early PyTorch version (1.0.0), while for installing transformer package, PyTorch 1.0.0 has incompatible issues.
Looking forward to your responses, thanks.
Hello Hang,
Would you please try PyTorch 1.9 (or 1.10). I just rechecked the virtual env we have and found the current environment file might have incorrect dependency version numbers.
Let me know if it works for you or not.
Hello Hang,
Would you please try PyTorch 1.9 (or 1.10). I just rechecked the virtual env we have and found the current environment file might have incorrect dependency version numbers.
Let me know if it works for you or not.
Thanks Ji, after upgrading PyTorch version to 1.9.0, it works!