Skip to content
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 'DwsConvBlock' from 'pytorchcv.models.common' #1664

Open
Anthony-Ho opened this issue Aug 29, 2024 · 1 comment · May be fixed by #1663
Open

cannot import name 'DwsConvBlock' from 'pytorchcv.models.common' #1664

Anthony-Ho opened this issue Aug 29, 2024 · 1 comment · May be fixed by #1663
Labels
bug Something isn't working

Comments

@Anthony-Ho
Copy link

🐛 Describe the bug
Using the colab notebook "02_models.ipynb", I encountered this error while executing the 2nd code block in the statement, "from avalanche.models import SimpleCNN".

🐜 To Reproduce
Run the "02_models.ipynd" in Google Colab

🐝 Expected behavior
No Errors and SampleCNN model is printed.

🐞 Screenshots

🦋 Additional context
The error happens in "/usr/local/lib/python3.10/dist-packages/avalanche/models/mobilenetv1.py". The original statements were:
try:
from pytorchcv.models.mobilenet import DwsConvBlock
except Exception:
from pytorchcv.models.common import DwsConvBlock

"DwsConvBlock" is coded in common/conv.py, so the correct code should be:
try:
from pytorchcv.models.mobilenet import DwsConvBlock
except Exception:
from pytorchcv.models.common.conv import DwsConvBlock

@Anthony-Ho Anthony-Ho added the bug Something isn't working label Aug 29, 2024
@gdacciaro
Copy link

The problem is that pytorchcv is just updated to v0.0.69 on colab.

You can workaround this by downgrade the version to 0.0.67 with:
!pip install pytorchcv==0.0.67

Most notebooks work after this workaround, apart from an exception: AttributeError: ‘SimpleCNN’ object has no attribute ‘recursive_adaptation’ in the section Nested Dynamic Modules.

But I'm afraid this is another problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants