Code Monkey home page Code Monkey logo

Comments (13)

YukioSama avatar YukioSama commented on July 3, 2024

soory,I did know

from rsnet.

YukioSama avatar YukioSama commented on July 3, 2024

help!too much problems like this:
from _ext import slice_unpool_layer
ImportError: cannot import name 'slice_unpool_layer'
please ?

from rsnet.

Timaces avatar Timaces commented on July 3, 2024

I meet the same question:ImportError: No module named _ext?can you help me ? thank you

from rsnet.

longmalongma avatar longmalongma commented on July 3, 2024

I meet the same question:ImportError: No module named _ext?can you help me ? thank you

Hi,when I try to run your code,I find I can not compile your slice_pool_layer and slice_unpool_layer,can you send me your files have compiled files?my email is that:[email protected] forward your reply

from rsnet.

zkm98 avatar zkm98 commented on July 3, 2024

this means we should learn how to compile the .c file, hope u could see the compile method in pointnet++ which also uses .c and .cuda files.

from rsnet.

DChoLee avatar DChoLee commented on July 3, 2024

I think this importerror is from circular dependency problem. In this repository, so many modules have same name such as slice_pool_layer. To avoid this issue, I copied slice_pool_layer 'in _ext folder' outside, and changed the slice_pool_layer.py which contains SP class to slice_pool_layer2.py and in net.py, I directly imported layers.slice_unpool_layer2 as import slice_unpool_layer2. Then you can call SP layer as slice_unpool_layer2.SP().

from rsnet.

MCemGunes avatar MCemGunes commented on July 3, 2024

Hi there, Is there anyone who could solve the problem? I followed the instructions in the layers folder. However, I still get the error. :
root@6e57005559fd:/app/RSNet# whereis cuda cuda: /usr/local/cuda

root@6e57005559fd:/app/RSNet# python train.py Traceback (most recent call last): File "train.py", line 76, in <module> from net import RSNet File "/app/RSNet/net.py", line 7, in <module> from layers.slice_pool_layer.slice_pool_layer import * File "/app/RSNet/layers/slice_pool_layer/slice_pool_layer.py", line 3, in <module> from _ext import slice_pool_layer ModuleNotFoundError: No module named '_ext'

root@6e57005559fd:/usr/local# ls bin cuda cuda-10.0 etc games include lib man sbin share src root@6e57005559fd:/usr/local# cd cuda-10.0/ root@6e57005559fd:/usr/local/cuda-10.0# ls LICENSE README bin compat doc extras include lib64 nvml nvvm share src targets version.txt root@6e57005559fd:/usr/local/cuda-10.0# cd targets/ root@6e57005559fd:/usr/local/cuda-10.0/targets# ls x86_64-linux root@6e57005559fd:/usr/local/cuda-10.0/targets# cd x86_64-linux/ root@6e57005559fd:/usr/local/cuda-10.0/targets/x86_64-linux# ls include lib root@6e57005559fd:/usr/local/cuda-10.0/targets/x86_64-linux# cd include/ root@6e57005559fd:/usr/local/cuda-10.0/targets/x86_64-linux/include# $CPATH=/usr/local/cuda-10.0/targets/x86_64-linux/include bash: /usr/usc/cuda/10.0/include/=/usr/local/cuda-10.0/targets/x86_64-linux/include: No such file or directory root@6e57005559fd:/usr/local/cuda-10.0/targets/x86_64-linux/include# CPATH=/usr/local/cuda-10.0/targets/x86_64-linux/include root@6e57005559fd:/usr/local/cuda-10.0/targets/x86_64-linux/include# cd /app/RSNet/ root@6e57005559fd:/app/RSNet# cdc layers/slice_pool_layer/src/cuda/ bash: cdc: command not found root@6e57005559fd:/app/RSNet# cd layers/slice_pool_layer/src/cuda/ root@6e57005559fd:/app/RSNet/layers/slice_pool_layer/src/cuda# nvcc -c -o slice_pool_layer_cuda_kernel.cu.o slice_pool_layer_cuda_kernel.cu -x cu -Xcompiler -fPIC -arch=sm_61 root@6e57005559fd:/app/RSNet/layers/slice_pool_layer/src/cuda# cd ../../ root@6e57005559fd:/app/RSNet/layers/slice_pool_layer# python build.py build /app/RSNet/layers/slice_pool_layer Build with GPU mode. running build running build_ext root@6e57005559fd:/app/RSNet/layers/slice_pool_layer# cd ../slice_unpool_layer/s slice_unpool_layer.py src/ root@6e57005559fd:/app/RSNet/layers/slice_pool_layer# cd ../slice_unpool_layer/s slice_unpool_layer.py src/ root@6e57005559fd:/app/RSNet/layers/slice_pool_layer# cd ../slice_unpool_layer/src/cuda/ root@6e57005559fd:/app/RSNet/layers/slice_unpool_layer/src/cuda# nvcc -c -o slice_unpool_layer_cuda_kernel.cu.o slice_unpool_layer_cuda_kernel.cu -x cu -Xcompiler -fPIC -arch=sm_61 root@6e57005559fd:/app/RSNet/layers/slice_unpool_layer/src/cuda# cd ../../ root@6e57005559fd:/app/RSNet/layers/slice_unpool_layer# py pyclean pydoc pydoc3 pygettext pygmentize python2 python3 python3.6 python3.6m pyvenv pyversions pycompile pydoc2.7 pydoc3.6 pygettext2.7 python python2.7 python3-config python3.6-config python3.6m-config pyvenv-3.6 root@6e57005559fd:/app/RSNet/layers/slice_unpool_layer# python build.py build /app/RSNet/layers/slice_unpool_layer Build with GPU mode. running build running build_ext root@6e57005559fd:/app/RSNet/layers/slice_unpool_layer# ls

from rsnet.

YukioSama avatar YukioSama commented on July 3, 2024

from rsnet.

MCemGunes avatar MCemGunes commented on July 3, 2024

I'm not sure if it is the best way to go but I think I've solved the problem.

First of all, you need to define the CPATH properly. In my case it is CPATH=/usr/local/cuda/include
You can check it by the whereis cuda command.

Secondly, You need to be careful about the computing capabilities of your graphic card. Otherwise, you will see Cuda-related errors when you run the train.py file. Such as this one ==> cudaCheckError() failed : no kernel image is available for execution on the device . I attach a website that includes the numbers for the Nvidia GPUs. In my case, it was 52, because I was using GTX 970m mobile GPU.

RSNet/layers/slice_pool_layer/src/cuda
nvcc -c -o slice_pool_layer_cuda_kernel.cu.o slice_pool_layer_cuda_kernel.cu -x cu -Xcompiler -fPIC -arch=sm_52 RSNet/layers/slice_unpool_layer/src/cuda
nvcc -c -o slice_unpool_layer_cuda_kernel.cu.o slice_unpool_layer_cuda_kernel.cu -x cu -Xcompiler -fPIC -arch=sm_52
Then, we need to run the build.py file in both RSNet/layers/slice_pool_layer/ and RSNet/layers/slice_unpool_layer/ directories by running python build.py build command. It will create a build folder including lib.linux-x86_64-3.6 that involves _ext folder.

I copied the _ext folders to directly RSNet/layers/slice_pool_layer/ RSNet/layers/slice_unpool_layer/ directories. So whenever slice_unpool_layer.py or slice_pool_layer.py looks for its _ext file we can import the _ext with a small update in both codes.

So I updated from _ext import slice_pool_layer line as from ._ext import slice_pool_layer (I did the same for the unpool one too.). I added . to represent the directory that we run the code (RSNet/layers/slice_pool_layer/ or RSNet/layers/slice_unpool_layer/)

And, voila! now you can get yourno module named CV2 error in peace 🦖

I hope it helps someone.

from rsnet.

lyz-zz avatar lyz-zz commented on July 3, 2024

I can't open 'link.exe' file, can you send me your files have compiled files? My email is: [email protected] thank you very much

from rsnet.

YukioSama avatar YukioSama commented on July 3, 2024

from rsnet.

Niko85858 avatar Niko85858 commented on July 3, 2024

您好,我编译文件失败了,出现很多无法解析的符号,能否发一份您已经编译好的文件?我的邮箱:[email protected],万分感谢!

from rsnet.

YukioSama avatar YukioSama commented on July 3, 2024

from rsnet.

Related Issues (16)

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.