voldemortX / pytorch-auto-drive

PytorchAutoDrive: Segmentation models (ERFNet, ENet, DeepLab, FCN...) and Lane detection models (SCNN, RESA, LSTR, LaneATT, BézierLaneNet...) based on PyTorch with fast training, visualization, benchmarking & deployment help
BSD 3-Clause "New" or "Revised" License
850 stars 138 forks source link

Sugggestion: Missing `requirements.txt` file. #37

Closed kalkun closed 3 years ago

kalkun commented 3 years ago

The installation instructions describe installing generally the packages:

pip install tqdm ujson tensorboard imageio opencv-python pyyaml thop Shapely p-tqdm scipy sklearn filetype

However, in doing so I get an error when simply trying to run:

python main_landec.py --help
Traceback (most recent call last):
  File "main_landec.py", line 11, in <module>
    from utils.losses import LaneLoss, SADLoss, HungarianLoss
  File "app/pytorch-auto-drive/utils/__init__.py", line 1, in <module>
    from . import datasets
  File "app/pytorch-auto-drive/utils/datasets/__init__.py", line 3, in <module>
    from .tusimple import *
  File "app/pytorch-auto-drive/utils/datasets/tusimple.py", line 5, in <module>
    from .utils import LaneKeypointDataset
  File "app/pytorch-auto-drive/utils/datasets/utils.py", line 5, in <module>
    from torch._six import container_abcs, string_classes, int_classes
ImportError: cannot import name 'container_abcs' from 'torch._six' (/opt/conda/lib/python3.8/site-pack
ages/torch/_six.py)

which at least to me indicates that the installed version of torch differs from the intended version and could perhaps be alleviated by specifying the exact version of the required packages.

voldemortX commented 3 years ago

Yes, you are right! We'll try add a requirements.txt in Q4.

The currently tested version is torch1.6.0cu102 and torch1.3.0cu90.

voldemortX commented 3 years ago

We do intend to support all pytorch version over 1.6, this seems to be a BC-Break from torch1.9

Zeleni9 commented 2 years ago

Hey, is the repo supporting torch > 1.6.0 ? The only issue it seems is this import:

from torch._six import container_abcs, string_classes, int_classes

Thank you.

voldemortX commented 2 years ago

@Zeleni9 It supports up to pt1.8. These lines are not supported any more in pytorch 1.9. Maybe we can do a version check and workaround here similar to https://github.com/voldemortX/pytorch-auto-drive/blob/eed417ff0fef46118cab310e69563358bf714b28/utils/all_utils_landec.py#L8

Zeleni9 commented 2 years ago

Yea I saw that I need:

and it works for me.