Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error when running show_seg.py #89

Open
xsf777 opened this issue Oct 22, 2021 · 4 comments
Open

Error when running show_seg.py #89

xsf777 opened this issue Oct 22, 2021 · 4 comments

Comments

@xsf777
Copy link

xsf777 commented Oct 22, 2021

OSError: no file with expected extension

File "F:/Users/lenovo/PycharmProjects/pythonProject6/pointnet.pytorch-master/utils/show_seg.py", line 2, in
from show3d_balls import showpoints
File "F:\Users\lenovo\PycharmProjects\pythonProject6\pointnet.pytorch-master\utils\show3d_balls.py", line 22, in
dll = np.ctypeslib.load_library('render_balls_so', '.')
File "F:\anaconda\envs\pytorch3\lib\site-packages\numpy\ctypeslib.py", line 155, in load_library
raise OSError("no file with expected extension")

@HeBangYan
Copy link

I refer to this link and put the following code:

import numpy as np
import ctypes as ct
import cv2
import sys
showsz = 800
mousex, mousey = 0.5, 0.5
zoom = 1.0
changed = True
def onmouse(*args):
global mousex, mousey, changed
y = args[1]
x = args[2]
mousex = x / float(showsz)
mousey = y / float(showsz)
changed = True
cv2.namedWindow('show3d')
cv2.moveWindow('show3d', 0, 0)
cv2.setMouseCallback('show3d', onmouse)
dll = np.ctypeslib.load_library('render_balls_so', '.')

change it to this:

import numpy as np
import ctypes as ct
import cv2
import sys
import os
BASE_DIR = os.path.dirname(os.path.abspath(__file__))
showsz=800
mousex,mousey=0.5,0.5
zoom=1.0
changed=True
def onmouse(*args):
    global mousex,mousey,changed
    y=args[1]
    x=args[2]
    mousex=x/float(showsz)
    mousey=y/float(showsz)
    changed=True
cv2.namedWindow('show3d')
cv2.moveWindow('show3d',0,0)
cv2.setMouseCallback('show3d',onmouse)


dll=np.ctypeslib.load_library(os.path.join(BASE_DIR, 'render_balls_so'),'.')

It's ready to go.

I hope that will help you. :)

@DW-sword
Copy link

DW-sword commented Nov 6, 2022

Thanks,this help me a lot

@meric-sakarya
Copy link

meric-sakarya commented Jan 26, 2023

@HeBangYan
Hello I tried your solution but nothing changed in my case. Do you have any suggestions? I am still receiving the same error.

@ocpinfo
Copy link

ocpinfo commented Feb 2, 2023

Actually there is the file 'render_balls_so.so' in the foloder of pointnet.pytorch/utils, So just modified as below:
dll = np.ctypeslib.load_library('render_balls_so.so', '.')

It worked for me, The error 'OSError: no file with expected extension' disappeared and the chair display in my macbook M1
Screenshot 2023-02-03 at 05 37 28

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants