New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
cannot import name 'container_abcs' from 'torch._six' #424
Comments
I met the same problem. Last month it is correct. |
Is it resolved for you? Or did you find a workaround? |
I think it is caused by the latest update of the code.
You can use the code version one month ago, or temporarily replace it with
the pre-trained model in torchvision module.
…On Sat, Jun 19, 2021 at 8:03 PM hariharasudhane ***@***.***> wrote:
Is it resolved for you? Or did you find a workaround?
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#424 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AJP2CWYA6VBFS4QUNKZ4RRTTTSBSNANCNFSM4662DMXA>
.
|
This was fixed in timm repository back in February: huggingface/pytorch-image-models@94ca140#diff-c7abf83bc43184f6101237b08d7c489c361f3d57b3538d633f6f01d35254b73c Maybe you should try to update timm |
@hariharasudhane I am facing the same problem. How to resolve it? |
@hariharasudhane i am also facing the same issue, is it resolved or did you find any workaround? |
Updating timm resolved this issue for me @Nitz93 @sumansahoo16 @JB-Bai |
It seems to depend on the encoder type.
But other encoders like 'efficientnet-b0' seem to work with updating timm. |
I have run pytest in this repo just after timm update.
This is the short summary of the
|
Sorry to say that my issue popped up again. MY STORY: SCENARIO 1: Then I started encountering the following error on any Architecture+Encoder combination SCENARIO 2: And one more error pops up that is: The above error doesn't affect the execution though. Hence I was happy, but the length of values error is making my training useless. SCENARIO 3: |
@hariharasudhane Where is this error message coming from? I think this message seems to be the pandas's error message. |
Oh yes. That error is unrelated to this thread. But mentioned that error anyway. I should play around with the dimensions maybe to resolve that value error. |
Can the Pytorch version give out the error? I just realized that the only change that has happened in my notebook between the errors popping up is the upgrade of pytorch to 1.9 from 1.8 in Google colab. I am running my notebook in colab btw. |
This is also discussed here: So, downgrading to the pytorch 1.8.1 will also fix the 'torch._six’ error. In colab, the commands will be like this:
|
Neither updating trimm (to 0.4.9) nor downgrading PyTorch to 1.8.1 worked for me.
|
Hmm, It seems to be strange for me because timm v0.4.9 does not have torch._siz dependency. What is given if you run this?
|
Thanks for the post i-aki-y! /usr/local/lib/python3.7/dist-packages/timm/models/layers/helpers.py in () ImportError: cannot import name 'container_abcs' from 'torch._six' (/usr/local/lib/python3.7/dist-packages/torch/_six.py) |
Finally this worked for me. |
Apologies the suggested solution (below) works - it appears I had installed packages later that updated PyTorch and reversed the forced downgrade!! Thanks for the help @i-aki-y , @hariharasudhane
|
I met the same issue. Upgrading timm worked for me. |
Package updated (0.2.0) with new timm==0.4.12 and tested with torch==1.9.0 |
You may change |
My solution was |
This worked for me as well. |
I was facing this issue while trying to import read_image from torchvision.io and |
I am also using colab and faced the same problem and arrived at this github. `!pip uninstall torch torchvision torchaudio torchtext timm import torch
from torch._six import container_abcs
|
I am working in Kaggle Notebooks and I tried
But still no luck. It still shows |
|
Encountering this from today: 19-Jun-2021
ImportError Traceback (most recent call last)
in ()
4 get_ipython().system('pip install -U segmentation-models-pytorch')
5
----> 6 import segmentation_models_pytorch as smp
7
8
11 frames
/usr/local/lib/python3.7/dist-packages/timm/models/layers/helpers.py in ()
4 """
5 from itertools import repeat
----> 6 from torch._six import container_abcs
7
8
ImportError: cannot import name 'container_abcs' from 'torch._six' (/usr/local/lib/python3.7/dist-packages/torch/_six.py)
The text was updated successfully, but these errors were encountered: