zhan-xu / RigNet

Code for SIGGRAPH 2020 paper "RigNet: Neural Rigging for Articulated Characters"
GNU General Public License v3.0
1.39k stars 191 forks source link

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

Open bycloudai opened 4 years ago

bycloudai commented 4 years ago

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~

zhan-xu commented 4 years ago

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?

bycloudai commented 4 years ago

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!

Danscap commented 4 years ago

@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.

zhan-xu commented 4 years ago

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 commented 4 years ago

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.

Danscap commented 4 years ago

@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?

zhan-xu commented 4 years ago

@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.

zhenqingkai commented 4 years ago

Great work, it works fine.

thinkingIsMagic commented 4 years ago

@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 commented 4 years ago

@ Danscap i run the code on server, ubuntu18

zhan-xu commented 4 years ago

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 ?

thinkingIsMagic commented 4 years ago

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

zhan-xu commented 4 years ago

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.

thinkingIsMagic commented 4 years ago

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...

zhan-xu commented 4 years ago

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.

thinkingIsMagic commented 4 years ago

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

dongfangliu commented 4 years ago

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 commented 4 years ago

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 commented 4 years ago

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.

thinkingIsMagic commented 4 years ago

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

image

zhan-xu commented 4 years ago

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.

dongfangliu commented 4 years ago

@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

thinkingIsMagic commented 4 years ago

@zhan-xu it's like this image

thinkingIsMagic commented 4 years ago

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

image

dongfangliu commented 4 years ago

@zhan-xu it's like this image

Now I have no idea

zhan-xu commented 4 years ago

@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 commented 3 years ago

Hi! Any updates on how to solve this problem?

leodilla commented 3 years ago

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
Mahyar-Ali commented 3 years ago

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

visonpon commented 2 years ago

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 isxvfb-run -a ./binvox -d -88 -pb,the error is : Error: could not create pbuffer

L1423 commented 1 year ago

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

I used the school's computing resources. So I do not have administrator rights and do not know how to install xvfb. I do not know where xvfb is installed on the school computing platform. I don't know what to do.

L1423 commented 1 year ago

我使用win下的binvox.exe 生成了相应的.binvox文件。应该和Linux下生成的一样吧。但是运行quick_start.py时,报错RuntimeError: Not compiled with CUDA support。有人有相同的错误吗,有什么解决的办法吗

L1423 commented 1 year ago

最后是直接按作者另一篇论文Morig的环境安装,最后成功了。应该是环境的一些依赖项没有安装到对应版本,或者缺了一些依赖项。

tshrjn commented 1 year ago

What worked for me:

sudo apt-get install libglu1-mesa # util for binvox
sudo apt-get install xvfb # for headless binvox usage
sudo apt-get install libspatialindex-dev # for rtree (part of trimesh) dependency

Even with xvfb, binvox doesn't support pbuffer - ref.

Try:

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

and

Xvfb-run -a ./binvox -d 88 quick_start/17872_remesh.obj  &

& update quick_start.py#L97 to:

os.system("xvfb-run -a ./binvox -d 88 " + mesh_filaname.replace("_remesh.obj", "_normalized.obj"))