Skip to content

find module path for python by modifying to relative module path #2

@yuyuan871111

Description

@yuyuan871111

Hi, I just installed your package via Type 2: Copy segmentation_models_pytorch_3d folder from this repository in your project folder. .

I discovered that certain files, particularly those in the model and decoder, rely on the segmentation_models_pytorch_3d module as part of the import root directory. This made it difficult for Python to locate the module when I copied the segmentation_models_pytorch_3d folder to my project directory. To resolve this, I changed the import format to a relative import (as attached). Is it a good choice to do so, or is there any solution to make Python find the files without modifying the source codes?

Screenshot 2024-03-14 at 17 22 38

Here is the list of files where I found the same issue. (maybe more)

modified:   segmentation_models_pytorch_3d/decoders/deeplabv3/model.py
modified:   segmentation_models_pytorch_3d/decoders/fpn/model.py
modified:   segmentation_models_pytorch_3d/decoders/linknet/decoder.py
modified:   segmentation_models_pytorch_3d/decoders/linknet/model.py
modified:   segmentation_models_pytorch_3d/decoders/manet/decoder.py
modified:   segmentation_models_pytorch_3d/decoders/manet/model.py
modified:   segmentation_models_pytorch_3d/decoders/pan/model.py
modified:   segmentation_models_pytorch_3d/decoders/pspnet/decoder.py
modified:   segmentation_models_pytorch_3d/decoders/pspnet/model.py
modified:   segmentation_models_pytorch_3d/decoders/unet/decoder.py
modified:   segmentation_models_pytorch_3d/decoders/unet/model.py
modified:   segmentation_models_pytorch_3d/decoders/unetplusplus/decoder.py
modified:   segmentation_models_pytorch_3d/decoders/unetplusplus/model.py
modified:   segmentation_models_pytorch_3d/encoders/__init__.py
modified:   segmentation_models_pytorch_3d/encoders/efficientnet.py

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions