Skip to content

Change PyTorch min version requirement#29364

Closed
dangkhoasdc wants to merge 1 commit intohuggingface:mainfrom
dangkhoasdc:patch-1
Closed

Change PyTorch min version requirement#29364
dangkhoasdc wants to merge 1 commit intohuggingface:mainfrom
dangkhoasdc:patch-1

Conversation

@dangkhoasdc
Copy link
Copy Markdown

What does this PR do?

As titled, If I installed the lower version (1.11+ < 2.2), I got the following issue:

>>> import transformers
Traceback (most recent call last):
 File "<stdin>", line 1, in <module>
 File "/xxx/lib/python3.9/site-packages/transformers/__init__.py", line 26, in <module>
  from . import dependency_versions_check
 File "/xxx/lib/python3.9/site-packages/transformers/dependency_versions_check.py", line 16, in <module>
  from .utils.versions import require_version, require_version_core
 File "/xxx/lib/python3.9/site-packages/transformers/utils/__init__.py", line 33, in <module>
  from .generic import (
 File "/xxx/lib/python3.9/site-packages/transformers/utils/generic.py", line 455, in <module>
  _torch_pytree.register_pytree_node(
AttributeError: module 'torch.utils._pytree' has no attribute 'register_pytree_node'

Before submitting

  • This PR fixes a typo or improves the docs (you can dismiss the other checks if that's the case).
  • Did you read the contributor guideline,
    Pull Request section?
  • Was this discussed/approved via a Github issue or the forum? Please add a link
    to it if that's the case.
  • Did you make sure to update the documentation with your changes? Here are the
    documentation guidelines, and
    here are tips on formatting docstrings.
  • Did you write any new necessary tests?

Who can review?

Anyone in the community is free to review the PR once the tests have passed. Feel free to tag
members/contributors who may be interested in your PR.

Documentation: @stevhliu and @MKhalusova

If I installed the lower version (1.11+ < 2.2), I got the following issue: 
```
module 'torch.utils._pytree' has no attribute 'register_pytree_node'
```
@Keneyr
Copy link
Copy Markdown

Keneyr commented Mar 20, 2024

I met with the same error, my environment is python==3.9, pytorch==1.13.1, pytorch-cuda==11.6, transformers==4.38.2, Is there another way to fix this problem rather than upgrade pytorch== 2.2x?

@stevhliu
Copy link
Copy Markdown
Member

Hi, unfortunately I'm unable to reproduce your issue with torch==1.11.0. Here's the install environment I used:

- `transformers` version: 4.38.2
- Platform: Linux-6.1.58+-x86_64-with-glibc2.35
- Python version: 3.10.12
- Huggingface_hub version: 0.20.3
- Safetensors version: 0.4.2
- Accelerate version: not installed
- Accelerate config: not found
- PyTorch version (GPU?): 1.11.0+cu102 (True)
- Tensorflow version (GPU?): 2.15.0 (True)
- Flax version (CPU?/GPU?/TPU?): 0.8.2 (gpu)
- Jax version: 0.4.23
- JaxLib version: 0.4.23
- Using GPU in script?: <fill in>
- Using distributed or parallel set-up in script?: <fill in>

cc @amyeroberts

@github-actions
Copy link
Copy Markdown
Contributor

This issue has been automatically marked as stale because it has not had recent activity. If you think this still needs to be addressed please comment on this thread.

Please note that issues that do not follow the contributing guidelines are likely to be ignored.

@github-actions github-actions bot closed this Apr 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants