Giter Site home page Giter Site logo

hikvision-research / sparseshiftlayer Goto Github PK

View Code? Open in Web Editor NEW
14.0 3.0 4.0 131 KB

An official implementation of CVPR 2019 paper "All You Need Is a Few Shifts: Designing Efficient Convolutional Neural Networks for Image Classification".

License: Apache License 2.0

Python 77.33% C++ 6.43% C 3.32% Cuda 12.82% Shell 0.10%
image-classification imagenet lightweight-neural-network mlp-mixer shiftnet

sparseshiftlayer's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

sparseshiftlayer's Issues

Question for ssl_cuda_kernel implementation

Thank you for your great work! In the paper, I see that using sparsity can reduce the memory movement in the shift operation, but in the code, the shift operation, \ie, ssl_cuda_kernel will always copy or move all the channels. The sparsity will thus not reduce the memory cost of the shift operation. So I wonder if the shift operation implementation in inference mode should be different from the training mode. If that's so, would you mind sharing the ssl_cuda_kernel implementation for the inference mode? Thanks a lot!

ImportError: DLL load failed: 找不到指定的模块。

版本:
python 3.7.12
pytorch 1.12.1
cuda 11.3
ninja 1.10.2

Using C:\Users\XXXX\AppData\Local\torch_extensions\torch_extensions\Cache\py37_cu113 as PyTorch extensions root...
Detected CUDA files, patching ldflags
Emitting ninja build file C:\Users\XXXX\AppData\Local\torch_extensions\torch_extensions\Cache\py37_cu113\ssl_cuda\build.ninja...
Building extension module ssl_cuda...
Allowing ninja to set a default number of workers... (overridable by setting the environment variable MAX_JOBS=N)
1.10.2.git.kitware.jobserver-1
Loading extension module ssl_cuda...
Traceback (most recent call last):
File "main.py", line 23, in
from models.SSL import SSL2d
File "D:\XXXX\tool\git repository\SparseShiftLayer-main\models\SSL.py", line 23, in
verbose=True)XXXX
File "D:\XXXX\anaconda\envs\yolov6_ssl_env\lib\site-packages\torch\utils\cpp_extension.py", line 1214, in load
keep_intermediates=keep_intermediates)
File "D:\XXXX\anaconda\envs\yolov6_ssl_env\lib\XXXXsite-packages\torch\utils\cpp_extension.py", line 1450, in _jit_compile
return _import_moduleXXXX_from_library(name, build_directory, is_python_module)
File "D:\XXXX\anaconda\envs\yolov6_ssl_env\lib\site-packages\torch\utils\cpp_extension.py", line 1844, in _import_module_from_library
module = importlib.util.module_from_spec(spec)
ImportError: DLL load failed: 找不到指定的模块

请问这个怎么解决/(ㄒoㄒ)/~~

ImportError: No module named 'ssl_cuda'

python 3.6
pytorch 1.4.0
torchvison 0.2.1
ninja 1.10.2.3

项目运行报错:
Using /tmp/torch_extensions as PyTorch extensions root...
Creating extension directory /tmp/torch_extensions/ssl_cuda...
Detected CUDA files, patching ldflags
Emitting ninja build file /tmp/torch_extensions/ssl_cuda/build.ninja...
Building extension module ssl_cuda...
1.10.2
Loading extension module ssl_cuda...
Traceback (most recent call last):
File "main.py", line 24, in
from models.SSL import SSL2d
File "/root/SparseShiftLayer-main/models/SSL.py", line 23, in
verbose=True)
File "/root/.local/conda/envs/fcos_3.6/lib/python3.6/site-packages/torch/utils/cpp_extension.py", line 680, in load
is_python_module)
File "/root/.local/conda/envs/fcos_3.6/lib/python3.6/site-packages/torch/utils/cpp_extension.py", line 877, in _jit_compile
return _import_module_from_library(name, build_directory, is_python_module)
File "/root/.local/conda/envs/fcos_3.6/lib/python3.6/site-packages/torch/utils/cpp_extension.py", line 1084, in _import_module_from_library
file, path, description = imp.find_module(module_name, [path])
File "/root/.local/conda/envs/fcos_3.6/lib/python3.6/imp.py", line 297, in find_module
raise ImportError(_ERR_MSG.format(name), name=name)
ImportError: No module named 'ssl_cuda'

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.