unilm icon indicating copy to clipboard operation
unilm copied to clipboard

which transformers version and pytorch version should be installed?

Open wnzhyee opened this issue 3 years ago • 2 comments

I try to use layoutlmv2model, and install the unilm following the layoutlmft:

datasets==1.6.2
torch==1.7.1+cu101
torchvision==0.8.2+cu101
transformers==4.5.1
detectron2==0.3
seqeval==1.2.2

this install successed but it reports "LayoutLMv2Model" is not in transformers namespace, so i install transformers 1.15.0 (which seems is the newest version) , at this time i import the model is ok:

from transformers import LayoutLMv2Model

but when i try create the instance, by :

model = LayoutLMv2Model.from_pretrained('microsoft/layoutxlm-base')

it's wrong again. The error is "AttributeError: module 'torch' has no attribute 'are_deterministic_algorithms_enabled'"

The "are_deterministic_algorithms_enabled" is available when pytorch version >=1.8.0, but if i reinstall pytorch, it seems the detectron2 need use a currect version too, cause of detectron reports "can not import _C" error when i try torch==1.8.1+cu101. (And torch version cannot be too new because tranformers seems rely on cuda10.1, but too new torch only has cuda10.2 or cuda11.3 version)

So, whats the newest version requirments now? Please update the layoutlmft requirments plz.

wnzhyee avatar Jan 20 '22 06:01 wnzhyee

Is there a solution for this? I'm having the exact same problem

imadcat avatar May 07 '23 19:05 imadcat

hi @imadcat , Could you please try installing PyTorch >= 1.8.1 and the latest Transformers, and then let me know if there is any error message?

Dod-o avatar May 24 '23 03:05 Dod-o