qubvel-org / segmentation_models.pytorch

Semantic segmentation models with 500+ pretrained convolutional and transformer-based backbones.
https://smp.readthedocs.io/
MIT License
9.58k stars 1.67k forks source link

pip package install does not include utils folder. #754

Closed AndrewFalkowski closed 1 year ago

AndrewFalkowski commented 1 year ago

Installing the package form pip into an anaconda environment does not appear to include files in the utils folder.

Calling dir(smp) returns the following:

['DeepLabV3',
 'DeepLabV3Plus',
 'FPN',
 'Linknet',
 'MAnet',
 'PAN',
 'PSPNet',
 'Unet',
 'UnetPlusPlus',
 '_Optional',
 '__builtins__',
 '__cached__',
 '__doc__',
 '__file__',
 '__loader__',
 '__name__',
 '__package__',
 '__path__',
 '__spec__',
 '__version__',
 '_torch',
 'base',
 'create_model',
 'datasets',
 'decoders',
 'encoders',
 'losses',
 'metrics']
AndrewFalkowski commented 1 year ago

Adding an update:

I was able to fix the issue by downloading the repo and adding the following import to segmentation_models_pytorch/__init__.py:

from . import utils

datasith commented 1 year ago

whelp, thank you for the timely fix @AndrewFalkowski! just ran into this myself

qubvel commented 1 year ago

Just try import segmentation_models_pytorch.utils as smp_utils

github-actions[bot] commented 1 year ago

This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 7 days.

github-actions[bot] commented 1 year ago

This issue was closed because it has been stalled for 7 days with no activity.