Open yuyuan871111 opened 8 months ago
I will try to fix it. If you install from the pip or if you import from the directory your main .py file is located it should work fine.
When I tried to install it from the poetry (almost the same as pip), it appeared a similar issue as using copy-paste installation.
Can you try to add in your .py file:
import sys
import os
sys.path.append(os.path.dirname(os.path.abspath(__file__)))
import segmentation_models_pytorch_3d
If your segmentation_models_pytorch_3d folder located in the same folder with your python file.
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 thesegmentation_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?Here is the list of files where I found the same issue. (maybe more)