# for building detectron conda install -c conda-forge gcc=11.2.0 conda install -c conda-forge gxx=11.2.0
conda env config vars set LD_LIBRARY_PATH="/home/cyl/miniconda3/envs/fcsgg/lib/" conda env config vars set CPATH="/home/cyl/miniconda3/envs/fcsgg/include/" conda env config vars set CUDA_HOME="/home/cyl/miniconda3/envs/fcsgg/"
File "/home/cyl/Reconst/fcsgg/fcsgg/data/detection_utils.py", line 432, in generate_score_map masked_fmap = torch.max(masked_fmap, gaussian_mask * k) RuntimeError: The size of tensor a (55) must match the size of tensor b (56) at non-singleton dimension 1
export DATASET=/pth/to/dataset # path to your coco data
一些绊脚石 ^ ^
1
根据[[Cuda+Torch]],需要先安装cudatoolkit和cuda-toolkit
1 2 3 4 5
conda install nvidia/label/cuda-11.7.0::cuda-toolkit -c nvidia/label/cuda-11.7.0 conda install cudatoolkit # no need to specify version conda env config vars set LD_LIBRARY_PATH="/home/cyl/miniconda3/envs/<name>/lib/" conda env config vars set CPATH="/home/cyl/miniconda3/envs/<name>/include/:/usr/include"# `/usr/include`for missing `crypt.h` conda env config vars set CUDA_HOME="/home/cyl/miniconda3/envs/<name>/"
如果编译时出现ld: cannot find -lcudart: No such file or directory collect2: error: ld returned 1 exit status 报错,只是因为没有安装cudatoolkit ^ ^
3
安装完成后直接import semantic_sam会报错ModuleNotFoundError: No module named 'MultiScaleDeformableAttention' ^ ^ 提示:
1 2 3
Please compile MultiScaleDeformableAttention CUDA op with the following commands: `cd mask2former[/modeling/pixel_decoder/ops](http://127.0.0.1:8888/modeling/pixel_decoder/ops)` `sh make.sh`
需要手动make一下 Mask2Former:
1 2
cd Mask2Former/mask2former/modeling/pixel_decoder/ops/ sh make.sh
A Git submodule allows a user to include a Git repository as a subdirectory of another Git repository. This can be useful when a project needs to include and use another project. For example, it may be a third-party library or a library developed independently for use in multiple parent projects. With submodules, these libraries can be managed as independent projects while being used in the user’s project. This allows for better organization and management of the code.
How to add a submodule to a project
To add an existing Git repository as a submodule to a project, the git submodule add command can be used. The command format is git submodule add <url> <path>, where <url> is the URL of the submodule repository and <path> is the storage path of the submodule in the project. For example, if a user wants to add the remote repository https://github.com/username/repo.git as a submodule to their project and store it in the my-submodule directory, they can use the following command: