Giter VIP home page Giter VIP logo

Comments (13)

duanduanduanyuchen avatar duanduanduanyuchen commented on May 29, 2024 1

Hi, I have more errors when I use python 3.7.. I cannot implement it, could you give me the code for training the model with the config and pth? Thank you!!!!

Hi! This code repo is the official implementation of ViT-Adapter. You can follow the guidelines in the README file to train/evaluate a model you like.

If you want to train Mask2Former-BeiT-Adapter, you should prepare an appropriate python environment. (Follow the instructions here. )
After that, you should also prepare some necessary files:

  1. Download the ade20k data to the directory ViT-Adapter/segmentation/data/;
  2. Download the pre-trained weight of BEiT-Large (here) to the directory ViT-Adapter/segmentation/pretrained/;

Your working dir should be ViT-Adapter/segmentation/.
Then run
sh dist_train.sh configs/ade20k/mask2former_beit_adapter_large_640_160k_ade20k_ss.py 8
for an 8-GPUs training, or run
python train.py configs/ade20k/mask2former_beit_adapter_large_640_160k_ade20k_ss.py
for a single-GPU training.

from vit-adapter.

duanduanduanyuchen avatar duanduanduanyuchen commented on May 29, 2024

Hello, when I run model_VitAdapter = init_segmentor(config_file_VitAdapter , checkpoint_file_VitAdapter, device='cuda:0'), it says this error, how to solve it~~ Thank you very much~~!

Hi! When you use EncoderDecoderMask2Former, you need to import package "mmseg_custom" and import EncoderDecoderMask2Former somewhere. Like file ViT-Adapter/segmentation/mmseg_custom/models/segmentors/__init__.py.

from vit-adapter.

Jinshan99 avatar Jinshan99 commented on May 29, 2024

Hi, after
!python mmseg_custom/models/segmentors/init.py I get

Traceback (most recent call last):
File "mmseg_custom/models/segmentors/init.py", line 2, in
from .encoder_decoder_mask2former import EncoderDecoderMask2Former
ImportError: attempted relative import with no known parent package
What should I change~~ Thank you!!

from vit-adapter.

duanduanduanyuchen avatar duanduanduanyuchen commented on May 29, 2024

Hi, after !python mmseg_custom/models/segmentors/init.py I get

Traceback (most recent call last): File "mmseg_custom/models/segmentors/init.py", line 2, in from .encoder_decoder_mask2former import EncoderDecoderMask2Former ImportError: attempted relative import with no known parent package What should I change~~ Thank you!!

You do not need to actually run the init file, just import mmseg_custom in your script and add your current work dir to your environment variable PYTHONPATH.

from vit-adapter.

Jinshan99 avatar Jinshan99 commented on May 29, 2024

when I type import mmseg_custom, there is ModuleNotFoundError: No module named 'mmdet' caused by ----> 3 from mmdet.utils import util_mixins

from vit-adapter.

duanduanduanyuchen avatar duanduanduanyuchen commented on May 29, 2024

when I type import mmseg_custom, there is ModuleNotFoundError: No module named 'mmdet' caused by ----> 3 from mmdet.utils import util_mixins

I think this error means you need to install "mmdet" first. You can follow the instructions in the Usage in here.

from vit-adapter.

Jinshan99 avatar Jinshan99 commented on May 29, 2024

I cannot install mmdet as your code to get the error of ERROR: Command errored out with exit status 1:
command: /home/jinshan/anaconda3/bin/python /home/jinshan/anaconda3/lib/python3.8/site-packages/pip install --ignore-installed --no-user --prefix /tmp/pip-build-env-81klhbox/overlay --no-warn-script-location --no-binary :none: --only-binary :none: -i https://pypi.org/simple -- 'cython>=0.27.3' oldest-supported-numpy 'setuptools>=43.0.0' wheel
cwd: None

I tried !pip install openmim
!mim install mmdet==2.22.0 but still got the error ERROR: Command errored out with exit status 1:
command: /home/jinshan/anaconda3/bin/python -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-download-arfq_jcg/mmdet/setup.py'"'"'; file='"'"'/tmp/pip-download-arfq_jcg/mmdet/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(file);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' egg_info --egg-base /tmp/pip-pip-egg-info-zyqum7yy
cwd: /tmp/pip-download-arfq_jcg/mmdet/
Complete output (2 lines):
Error: mkl-service + Intel(R) MKL: MKL_THREADING_LAYER=INTEL is incompatible with libgomp.so.1 library.
Try to import numpy first or set the threading layer accordingly. Set MKL_SERVICE_FORCE_INTEL to force it.

Have you met the same problem and how have you solved~ Thank you very very much

from vit-adapter.

Jinshan99 avatar Jinshan99 commented on May 29, 2024

Oh I found it could work on python 3.7, I am using the 3.8.. I will try it later~~ Thank you

from vit-adapter.

Jinshan99 avatar Jinshan99 commented on May 29, 2024

Hi, I have more errors when I use python 3.7.. I cannot implement it, could you give me the code for training the model with the config and pth? Thank you!!!!

from vit-adapter.

Jinshan99 avatar Jinshan99 commented on May 29, 2024

Hi, I got the error "EncoderDecoder: 'BEiTAdapter is not in the models registry'" and I imported the mmseg_custom got error:/ViT-Adapter/segmentation/mmseg_custom/models/backbones/beit_adapter.py in
8 import torch.nn.functional as F
9 from mmseg.models.builder import BACKBONES
---> 10 from ops.modules import MSDeformAttn
11 from timm.models.layers import DropPath, trunc_normal_
12 from torch.nn.init import normal_

ModuleNotFoundError: No module named 'ops.modules'

from vit-adapter.

duanduanduanyuchen avatar duanduanduanyuchen commented on May 29, 2024

Hi, I got the error "EncoderDecoder: 'BEiTAdapter is not in the models registry'" and I imported the mmseg_custom got error:/ViT-Adapter/segmentation/mmseg_custom/models/backbones/beit_adapter.py in 8 import torch.nn.functional as F 9 from mmseg.models.builder import BACKBONES ---> 10 from ops.modules import MSDeformAttn 11 from timm.models.layers import DropPath, trunc_normal_ 12 from torch.nn.init import normal_

ModuleNotFoundError: No module named 'ops.modules'

Hi, you need to compile the ops module first. You can follow the last two lines of instructions in the usage. First, compile the module in the detection folder and create a soft link to ops in the segmentation folder.

from vit-adapter.

Jinshan99 avatar Jinshan99 commented on May 29, 2024

Hi, I followed the last two lines and get error:
Traceback (most recent call last):
File "setup.py", line 70, in
ext_modules=get_extensions(),
File "setup.py", line 43, in get_extensions
raise NotImplementedError('Cuda is not availabel')
NotImplementedError: Cuda is not availabel
from the command line sh make.sh
which the error comes from if torch.cuda.is_available() and CUDA_HOME is not None:...else.....
I tried shows the torch.cuda.is_available() is True but CUDA_HOME is None, so what could I do to solve it~~~ Thank you

from vit-adapter.

duanduanduanyuchen avatar duanduanduanyuchen commented on May 29, 2024

Hi, I followed the last two lines and get error: Traceback (most recent call last): File "setup.py", line 70, in ext_modules=get_extensions(), File "setup.py", line 43, in get_extensions raise NotImplementedError('Cuda is not availabel') NotImplementedError: Cuda is not availabel from the command line sh make.sh which the error comes from if torch.cuda.is_available() and CUDA_HOME is not None:...else..... I tried shows the torch.cuda.is_available() is True but CUDA_HOME is None, so what could I do to solve it~~~ Thank you

I think you can add the path to CUDA to your environment variables and try the 'sh' command again.

from vit-adapter.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.