QUVA-Lab / e2cnn

E(2)-Equivariant CNNs Library for Pytorch
https://quva-lab.github.io/e2cnn/
Other
596 stars 75 forks source link

Cannot import name container_abcs in python 3.6 version (e2cnn_py36) #74

Closed saeejithnair closed 1 year ago

saeejithnair commented 1 year ago

As documented in https://github.com/QUVA-Lab/e2cnn/issues/63, the legacy Python 3.6 branch remains broken.

This issue appears to have been resolved on the main branch as documented in https://github.com/QUVA-Lab/e2cnn/issues/48, but for Python 3.6 with PyTorch==1.9.0, I get the following error on the Jetson-Nano:

root@nano:/home/e2cnn# python3
Python 3.6.9 (default, Jan 26 2021, 15:33:00)
[GCC 8.4.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import torch
>>> torch.__version__
'1.9.0'
>>> from e2cnn import nn as e2nn
2023-02-24 06:26:04.142987: I tensorflow/stream_executor/platform/default/dso_loader.cc:49] Successfully opened dynamic library libcudart.so.10.2
WARNING:tensorflow:Deprecation warnings have been disabled. Set TF_ENABLE_DEPRECATION_WARNINGS=1 to re-enable them.
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/flairop/e2cnn/e2cnn/nn/__init__.py", line 5, in <module>
    from .modules import *
  File "/home/flairop/e2cnn/e2cnn/nn/modules/__init__.py", line 50, in <module>
    from .module_list import ModuleList
  File "/home/flairop/e2cnn/e2cnn/nn/modules/module_list.py", line 4, in <module>
    from torch._six import container_abcs
ImportError: cannot import name 'container_abcs'
>>>

This PR fixes the issue on the legacy_py3.6 branch by cherry-picking commits from https://github.com/QUVA-Lab/e2cnn/pull/44

Gabri95 commented 1 year ago

hi @saeejithnair

I am trying to deprecate this older version of the library in favour of the new escnn library.

Moreover, note that Python 3.6 itself has been deprecated for more than one year now. For this reason, the python 3.6 branch of the library has not been updated for some time and might miss a few features of the main library.

If possible, I would recommend you to move to a newer python version (at least 3.7) and, possibly, use the newer escnn library.

If that is really not possible, I can try to take a look at this but, again, a number of features will be necessarily missing

Best, Gabriele

saeejithnair commented 1 year ago

Hi @Gabri95, thanks for the response! While I understand that Python 3.6 has been deprecated, there are a number of older embedded devices in the field that still run Python 3.6, and depend on libraries that support 3.6. They'll be upgraded in the near future but until then, we still need to support them.

Also based on the issues I linked, it appears others have run into the same situation as me (even recently).

I think it's alright that the legacy branch is missing newer features. For libraries that have e2cnn as a dependency, I've rolled them back on my end to the date from 2 years ago to ensure compatibility with the legacy 3.6 branch.

Thanks, Saeejith

Gabri95 commented 1 year ago

Hi @saeejithnair

I see your point, thanks!

I will try to fix this branch then

Thanks, Gabriele