RigNet icon indicating copy to clipboard operation
RigNet copied to clipboard

[Open3D WARNING] Read OBJ failed: Cannot open file [quick_start/17872_remesh.obj]

Open bycloudai opened this issue 4 years ago • 34 comments

Hi. I got the following error when I ran python quick_start.py

loading all networks...
     joint prediction network loaded.
     root prediction network loaded.
     connection prediction network loaded.
     skinning prediction network loaded.
creating data for model ID 17872
[Open3D WARNING] Read OBJ failed: Cannot open file [quick_start/17872_remesh.obj]

     gathering topological edges.
Traceback (most recent call last):
  File "quick_start.py", line 390, in <module>
    data, vox, surface_geodesic = create_single_data(mesh_filename)
  File "quick_start.py", line 56, in create_single_data
    tpl_e = get_tpl_edges(mesh_v, mesh_f).T
  File "/home/cloud/youtube/rignet/RigNet/gen_dataset.py", line 33, in get_tpl_edges
    edge_index = np.concatenate(edge_index, axis=0)
  File "<__array_function__ internals>", line 6, in concatenate
ValueError: need at least one array to concatenate

How can I fix this? Thank you~

bycloudai avatar Jul 26 '20 16:07 bycloudai

I tried this and it worked fine. It seems from the error that it cannot find that OBJ file. Could you check your current working path? This OBJ file is in the folder "quick_start ", so maybe you try to make the path correct?

zhan-xu avatar Jul 26 '20 17:07 zhan-xu

I realized I need to change the model id inside quick_start.py But even after I changed the model ID in quick_start.py I got another error:

loading all networks...
     joint prediction network loaded.
     root prediction network loaded.
     connection prediction network loaded.
     skinning prediction network loaded.
creating data for model ID 1347
     gathering topological edges.
     calculating surface geodesic matrix.
surface geodesic calculation: 6.1555070877075195 seconds
     gathering geodesic edges.

--- [binvox] mesh voxelizer, version 1.26, build #644 on 2017/10/22 15:19:22
--- written by Patrick Min, 2004-2017

  will use offscreen pbuffer instead of onscreen window
loading model file...
MeshFileIdentifier::*create_mesh_file(quick_start/1347_remesh.obj)
ObjMeshFile::load(quick_start/1347_remesh.obj)
9800 quick_start/1347_remesh.obj
  9801 lines read
Read 4842 faces, 2478 vertices.
Mesh memory use is 3040 KB (2 MB)
  Mesh::normalize, bounding box: [-0.422843, 0, -0.5, 1] - [0.422843, 0.70882, 0.5, 1]
    longest length: 1
  normalization transform:
  (1) translate [0.422843, -0, 0.5, 1], (2) scale 1, (3) translate [0, 0, 0]
freeglut (./binvox): failed to open display ''
Traceback (most recent call last):
  File "quick_start.py", line 390, in <module>
    data, vox, surface_geodesic = create_single_data(mesh_filename)
  File "quick_start.py", line 76, in create_single_data
    with open(mesh_filaname.replace('.obj', '.binvox'), 'rb') as fvox:
FileNotFoundError: [Errno 2] No such file or directory: 'quick_start/1347_remesh.binvox'

Here's a screenshot of my files: qwrfaxc

and also how can we test out our own 3D mesh? Do we just need one single .obj file? Thank you!

bycloudai avatar Jul 27 '20 04:07 bycloudai

@zhan-xu @cloudweather I am having the same issue, well the last line of the error is the same.

loading all networks...
     joint prediction network loaded.
     root prediction network loaded.
     connection prediction network loaded.
     skinning prediction network loaded.
creating data for model ID 17872
     gathering topological edges.
     calculating surface geodesic matrix.
surface geodesic calculation: 6.807190418243408 seconds
     gathering geodesic edges.
'.' is not recognized as an internal or external command,
operable program or batch file.
Traceback (most recent call last):
  File "quick_start.py", line 390, in <module>
    data, vox, surface_geodesic = create_single_data(mesh_filename)
  File "quick_start.py", line 76, in create_single_data
    with open(mesh_filaname.replace('.obj', '.binvox'), 'rb') as fvox:
FileNotFoundError: [Errno 2] No such file or directory: 'quick_start/17872_remesh.binvox'

I'm not sure how your error code is different from mine when they both end with the same error.

Danscap avatar Jul 27 '20 04:07 Danscap

Based on https://unix.stackexchange.com/questions/155418/binvox-not-working-on-a-headless-linux-server, I suggest you try to install Xvfb. In the code I use binvox (https://www.patrickmin.com/binvox/) to voxelize the model interior, and the reported error comes from the error of calling binvox.

zhan-xu avatar Jul 27 '20 13:07 zhan-xu

And yes, you need only input a single model, with vertices number between 1K to 5K (since we trained on models with such resolution). You can immigrate to original resolution with nearest-neighbor. Look at the very end (line 402-line 410) of quick_start.py.

zhan-xu avatar Jul 27 '20 13:07 zhan-xu

@zhan-xu Thank you. For windows, we must download binvox and change the quick_start.py to use it?

I see that starting at line 75 uses it, but as a linux command (?) :

image

Also I was not aware that models should be between 1k-5k vertices. I frequently work with humanoid models that number > 20k vertices. I could bring this number down with Blender's decimate modifier. Would 6-10k still produce working results?

Danscap avatar Jul 27 '20 14:07 Danscap

@Danscap Yes. I attached a Linux version of binvox under the root folder, but you are right, to use it under Windows, you will have to download the windows version from here https://www.patrickmin.com/binvox/download.php?id=2, and change the line as you showed above to "binvox.exe -d 88 -pb".

It is better to keep vertices of test models between 1K-5K since the networks are trained on such data. you may try with 6-10K vertices, but it will become very slow (I have a volumetric geodesic distance calculation which shoots rays and finds intersection on the surface. This step is time-consuming for now). You can first decimate the mesh and name is as xxx_remesh.obj, also name the original mesh with high-res as xxx_ori.obj, just as the examples I put in the quick_start folder. Lines 404-406 will immigrate the results back to the original resolution.

zhan-xu avatar Jul 27 '20 20:07 zhan-xu

Great work, it works fine.

zhenqingkai avatar Aug 04 '20 10:08 zhenqingkai

@Danscap i have the same problem image then i run the code : apt-get install xvfb , and i still get the same problem. how did you solve it ?

thinkingIsMagic avatar Sep 08 '20 01:09 thinkingIsMagic

@ Danscap i run the code on server, ubuntu18

thinkingIsMagic avatar Sep 08 '20 01:09 thinkingIsMagic

Hi, from the output, seems binvox is not properly called. The error is the it cannot find "libGLU.so".

Could you try https://askubuntu.com/questions/386281/error-while-loading-shared-libraries-libglu-so-1 ?

zhan-xu avatar Sep 08 '20 02:09 zhan-xu

Hi, from the output, seems binvox is not properly called. The error is the it cannot find "libGLU.so".

Could you try https://askubuntu.com/questions/386281/error-while-loading-shared-libraries-libglu-so-1 ?

it seems work, but i get another issue, 'freeglut (./binvox): failed to open display ':25''

image

thinkingIsMagic avatar Sep 08 '20 02:09 thinkingIsMagic

The most related answer I can find is this: https://unix.stackexchange.com/questions/155418/binvox-not-working-on-a-headless-linux-server?rq=1

Since you have already installed Xvfb, could you try to configure as they suggested? You might need to add a "&" to the code. (Line 94 in quick_start.py, change to os.system("./binvox -d 88 -pb &" + mesh_filaname.replace("_remesh.obj", "_normalized.obj")) as they suggested.

zhan-xu avatar Sep 08 '20 02:09 zhan-xu

The most related answer I can find is this: https://unix.stackexchange.com/questions/155418/binvox-not-working-on-a-headless-linux-server?rq=1

Since you have already installed Xvfb, could you try to configure as they suggested? You might need to add a "&" to the code. (Line 94 in quick_start.py, change to os.system("./binvox -d 88 -pb &" + mesh_filaname.replace("_remesh.obj", "_normalized.obj")) as they suggested.

屏幕快照 2020-09-11 上午11 08 39

still got mistakes, I'm so sad...

thinkingIsMagic avatar Sep 11 '20 11:09 thinkingIsMagic

I saw a permission deny error from binvox. Could you try directly from the terminal "./binvox -d 88 -pb quick_start/17872_remesh.obj"? So that the error will be more clear. Maybe you need a "sudo" before it.

zhan-xu avatar Sep 11 '20 13:09 zhan-xu

I saw a permission deny error from binvox. Could you try directly from the terminal "./binvox -d 88 -pb quick_start/17872_remesh.obj"? So that the error will be more clear. Maybe you need a "sudo" before it.

it says pbuffers not available

屏幕快照 2020-09-12 下午3 50 12

thinkingIsMagic avatar Sep 12 '20 07:09 thinkingIsMagic

I saw a permission deny error from binvox. Could you try directly from the terminal "./binvox -d 88 -pb quick_start/17872_remesh.obj"? So that the error will be more clear. Maybe you need a "sudo" before it.

it says pbuffers not available

屏幕快照 2020-09-12 下午3 50 12

Yes, I met the same problem, when it goes to pbuffers, my gui suddenly restart.

dongfangliu avatar Sep 12 '20 15:09 dongfangliu

I saw a permission deny error from binvox. Could you try directly from the terminal "./binvox -d 88 -pb quick_start/17872_remesh.obj"? So that the error will be more clear. Maybe you need a "sudo" before it.

it says pbuffers not available 屏幕快照 2020-09-12 下午3 50 12

Yes, I met the same problem, when it goes to pbuffers, my gui suddenly restart.

Oh that's cool, if I remove -pb parameter, renders onscreen is fully ok. I guess pbuffer is not available is caused by my usage of a remote desktop like anydesk which already occupies the pbuffer. I will check when I come to my desktop face2face.

dongfangliu avatar Sep 12 '20 15:09 dongfangliu

Cool, you have to just remove the -pb parameter in quick-start.py. Then you can run the program properly. Thanks, I tried this code for 8 hours and finally get it to work under CUDA11.0. Haha, built all of the torch stuff from source.

dongfangliu avatar Sep 12 '20 16:09 dongfangliu

@dongfangliu thank u. i have tried this code for serverals days, =.=. I delete the pb, but i still get probelm: Badwindow

image

thinkingIsMagic avatar Sep 14 '20 01:09 thinkingIsMagic

The most related answer I can find is this: https://unix.stackexchange.com/questions/155418/binvox-not-working-on-a-headless-linux-server?rq=1 Since you have already installed Xvfb, could you try to configure as they suggested? You might need to add a "&" to the code. (Line 94 in quick_start.py, change to os.system("./binvox -d 88 -pb &" + mesh_filaname.replace("_remesh.obj", "_normalized.obj")) as they suggested.

屏幕快照 2020-09-11 上午11 08 39

still got mistakes, I'm so sad...

Actually this seems promising to me. Your screenshot doesn't have the commands you ran. Could I take a look at what commands for this?

Just run the following commands. Don't bother RigNet at this point.

Xvfb :25 -screen 0 1900x1080x32 &
export DISPLAY=:25
./binvox -d 88 -pb quick_start/17872_remesh.obj  &

I think the modification I told you before reverses the order of "&" and the mesh filename.

zhan-xu avatar Sep 14 '20 04:09 zhan-xu

@dongfangliu thank u. i have tried this code for serverals days, =.=. I delete the pb, but i still get probelm: Badwindow

image

./binvox -d 88 quick_start/17872_remesh.obj Try this

dongfangliu avatar Sep 14 '20 05:09 dongfangliu

@zhan-xu it's like this image

thinkingIsMagic avatar Sep 15 '20 07:09 thinkingIsMagic

@dongfangliu yes, i input: ./binvox -d 88 quick_start/17872_remesh.obj it says BadWindow

image

thinkingIsMagic avatar Sep 15 '20 07:09 thinkingIsMagic

@zhan-xu it's like this image

Now I have no idea

dongfangliu avatar Sep 15 '20 08:09 dongfangliu

@jiandandian2 One quick try could be changing the port to some other number rather than 25, such as 19 (https://unix.stackexchange.com/questions/9107/how-can-i-run-firefox-on-linux-headlessly-i-e-without-requiring-libgtk-x11-2-0/9118#9118).

Another thing you can try is instead of using remote desk, you can use a terminal to ssh to the remote server and see how it works. My feeling is the remote desk messes up the display devices.

zhan-xu avatar Sep 15 '20 14:09 zhan-xu

Hi! Any updates on how to solve this problem?

zhan-xu avatar Apr 11 '21 06:04 zhan-xu

It seems that Xvfb is necessary for running binvox on headless servers, accroding to the binvox developer. $Sbatch method maybe drop in endless waiting for the '> Internal error: Could not resolve keysym XF86RotationLockToggle'. There might be issues with running binvox/xvfb on headless servers about how to terminate/kill the process.

So I use $srun method instead and add 'xvfb-run -d' before all './binvox' in the python file , then the problem is solved. -d refers to use the X server to find a display number automatically.

xvfb-binvox

leodilla avatar May 03 '21 06:05 leodilla

This worked for me.

install libglu1-mesa install binvox install xvfb create a virtual frame buffer using Xvfb :25 -screen 0 1900x1080x16 & Xvfb works fine at depths 15, 16, 24 and finally, export the display using export DISPLAY:=25

Mahyar-Ali avatar Nov 16 '21 13:11 Mahyar-Ali

Hi @leodilla ,I try to use xvfb-run, but get another problem, hope you help. since I use this project on virtual machine, my command is xvfb-run -a ./binvox -d -88 -pb,the error is : Error: could not create pbuffer

visonpon avatar Dec 22 '21 02:12 visonpon