Git Product home page Git Product logo

addernetcuda's People

Stargazers

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

Watchers

 avatar  avatar

addernetcuda's Issues

How to run via multi GPU?

Hello, I have a question. It seems that you set your code running on just one gpu, and how can I run via multi gpu?

Unable to import CUDA unoptimized kernels

I have download the whole files AdderNetCuda, and then I put it on cloud platform.
cd unoptimized
python setup.py install
python test.py

Question is :

  • I want to know the solution to the problem "Unable to import CUDA unoptimized kernels"

The environment is :
NVIDIA GeForce RTX 3080, 1

The version of torch and torchvision are :
torch 1.10.0+cu111
torchvision 0.11.0+cu111

However, I cannot get the results of method using cuda. The program gives me

  • Unable to import CUDA unoptimized kernels
    x:=================
    tensor([[[[0.1350, 0.9071, 0.3186],
    [0.4736, 0.1879, 0.0715],
    [0.7890, 0.5512, 0.1568]]]], device='cuda:0')
    w:=================
    tensor([[[[0.9958]]]], device='cuda:0')
    grad_y:=================
    tensor([[[[0.9757, 0.5837],
    [0.2281, 0.6243]]]], device='cuda:0')
    Traceback (most recent call last):
    File "test.py", line 310, in
    conv_input_test()
    File "test.py", line 287, in conv_input_test
    grad_x = conv_input(grad_y, x, w, [stride,], [padding,])
    File "test.py", line 86, in conv_input
    unoptimized_cuda.UNOPTIMIZED_CONV_INPUT(grad_y, x, w, grad_x, strides, paddings)
    NameError: name 'unoptimized_cuda' is not defined

The log of install unoptimized is :

  • ......
  • creating build/lib.linux-x86_64-cpython-38
    x86_64-linux-gnu-g++ -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions -Wl,-Bsymbolic-functions -Wl,-z,relro -g -fwrapv -O2 build/temp.linux-x86_64-cpython-38/unoptimized.o build/temp.linux-x86_64-cpython-38/unoptimized_cuda.o -L/usr/local/lib/python3.8/dist-packages/torch/lib -L/usr/local/cuda/lib64 -L/usr/lib -lc10 -ltorch -ltorch_cpu -ltorch_python -lcudart -lc10_cuda -ltorch_cuda_cu -ltorch_cuda_cpp -o build/lib.linux-x86_64-cpython-38/unoptimized_cuda.cpython-38-x86_64-linux-gnu.so
    creating build/bdist.linux-x86_64
    creating build/bdist.linux-x86_64/egg
    copying build/lib.linux-x86_64-cpython-38/unoptimized_cuda.cpython-38-x86_64-linux-gnu.so -> build/bdist.linux-x86_64/egg
    creating stub loader for unoptimized_cuda.cpython-38-x86_64-linux-gnu.so
    byte-compiling build/bdist.linux-x86_64/egg/unoptimized_cuda.py to unoptimized_cuda.cpython-38.pyc
    creating build/bdist.linux-x86_64/egg/EGG-INFO
    copying unoptimized_cuda.egg-info/PKG-INFO -> build/bdist.linux-x86_64/egg/EGG-INFO
    copying unoptimized_cuda.egg-info/SOURCES.txt -> build/bdist.linux-x86_64/egg/EGG-INFO
    copying unoptimized_cuda.egg-info/dependency_links.txt -> build/bdist.linux-x86_64/egg/EGG-INFO
    copying unoptimized_cuda.egg-info/top_level.txt -> build/bdist.linux-x86_64/egg/EGG-INFO
    writing build/bdist.linux-x86_64/egg/EGG-INFO/native_libs.txt
    zip_safe flag not set; analyzing archive contents...
    pycache.unoptimized_cuda.cpython-38: module references file
    creating dist
    creating 'dist/unoptimized_cuda-0.0.0-py3.8-linux-x86_64.egg' and adding 'build/bdist.linux-x86_64/egg' to it
    removing 'build/bdist.linux-x86_64/egg' (and everything under it)
    Processing unoptimized_cuda-0.0.0-py3.8-linux-x86_64.egg
    creating /usr/lib/python3.8/site-packages/unoptimized_cuda-0.0.0-py3.8-linux-x86_64.egg
    Extracting unoptimized_cuda-0.0.0-py3.8-linux-x86_64.egg to /usr/lib/python3.8/site-packages
    Adding unoptimized-cuda 0.0.0 to easy-install.pth file

Installed /usr/lib/python3.8/site-packages/unoptimized_cuda-0.0.0-py3.8-linux-x86_64.egg
Processing dependencies for unoptimized-cuda==0.0.0
Finished processing dependencies for unoptimized-cuda==0.0.0

Issue while running train.py

I followed the instructions in the readme file to run the code and getting the following error. Am I doing something wrong?

File "/content/utils.py", line 39, in accuracy
correct_k = correct[:k].view(-1).float().sum(0, keepdim=True)
RuntimeError: view size is not compatible with input tensor's size and stride (at least one dimension spans across two contiguous subspaces). Use .reshape(...) instead.

I have not made any changes to the code.

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.