BerkeleyAutomation / dex-net

Repository for reading the Dex-Net 2.0 HDF5 database of 3D objects, parallel-jaw grasps, and robust grasp metrics
https://berkeleyautomation.github.io/dex-net/code.html
Other
296 stars 97 forks source link

Unable to display object #45

Open dj4park opened 5 years ago

dj4park commented 5 years ago

Trying to install dex-net on Jetson TX2 with ROS Kinetic on Ubuntu 16.04 LTS but I am getting a bunch of errors.

Running python apps/dexnet_cli.py and selecting an object from example.hdf5 as mentioned here leads to the following errors.

WARNING:root:Unable to import pylibfreenect2. Python-only Kinect driver may not work properly.
WARNING:root:Failed to import ROS in Kinect2_sensor.py. Kinect will not be able to be used in bridged mode
WARNING:root:Unable to import openni2 driver. Python-only Primesense driver may not work properly
WARNING:root:Unable to import pyrealsense2.
WARNING:root:Failed to import ROS in ensenso_sensor.py. ROS functionality not available
WARNING:root:Failed to import ROS in phoxi_sensor.py. PhoXiSensor functionality unavailable.
root       WARNING  Failed to import gqcnn! Grasp2D functions will not be available.
root       WARNING  Failed to import mayavi
root       WARNING  Failed to import mayavi
root       WARNING  Failed to import mayavi
root       WARNING  Failed to import mayavi
root       WARNING  Failed to import mayavi
root       WARNING  Failed to import OpenRAVE
root       WARNING  Failed to import mayavi
root       WARNING  Failed to import OpenRAVE
dexnet.api WARNING  Failed to import DexNetVisualizer3D, visualization methods will be unavailable

Because of this I cannot visualize the models.

smmukhal commented 4 years ago

I have also installed Dexnet from the installation instructions given https://docs.google.com/document/d/1YImq1cBTy9E1n1On6-00gueDT4hfmYJK4uOcxZIzPoY/edit I am running Ubuntu 16.04 LTS with ROS Kinetic. I am having the same error as you. Did you find a work around for this issue?

fattyhu commented 4 years ago

I also have meet same problem. I can not import the gqcnn and Dexnetvisualizer3D and visualization. I install dex-net and pass the: python setup.py test.

I install dex-net package on Ubuntu16.04 and ROS-Kinetic. I choose sudo sh install.sh gpu ros to install the package

running test
WARNING: Testing via this command is deprecated and will be removed in a future version. Users looking for a generic test entry point independent of test runner are encouraged to use tox.
running egg_info
writing requirements to src/dex_net.egg-info/requires.txt
writing src/dex_net.egg-info/PKG-INFO
writing top-level names to src/dex_net.egg-info/top_level.txt
writing dependency_links to src/dex_net.egg-info/dependency_links.txt
reading manifest file 'src/dex_net.egg-info/SOURCES.txt'
writing manifest file 'src/dex_net.egg-info/SOURCES.txt'
running build_ext
/usr/local/lib/python2.7/dist-packages/requests/__init__.py:83: RequestsDependencyWarning: Old version of cryptography ([1, 2, 3]) may cause slowdown.
  warnings.warn(warning, RequestsDependencyWarning)
WARNING:root:Unable to import pylibfreenect2. Python-only Kinect driver may not work properly.
WARNING:root:Failed to import ROS in Kinect2_sensor.py. Kinect will not be able to be used in bridged mode
WARNING:root:Unable to import openni2 driver. Python-only Primesense driver may not work properly
WARNING:root:Unable to import pyrealsense2.
WARNING:root:Failed to import ROS in ensenso_sensor.py. ROS functionality not available
WARNING:root:Failed to import ROS in phoxi_sensor.py. PhoXiSensor functionality unavailable.
WARNING:tensorflow:From /home/fattyhu/catkin_ws/src/gqcnn/gqcnn/utils/enums.py:44: The name tf.RunOptions is deprecated. Please use tf.compat.v1.RunOptions instead.

WARNING:tensorflow:From /home/fattyhu/catkin_ws/src/gqcnn/gqcnn/utils/enums.py:44: The name tf.RunOptions is deprecated. Please use tf.compat.v1.RunOptions instead.

OpenGL.acceleratesupport INFO     OpenGL_accelerate module loaded
OpenGL.arrays.arraydatatype INFO     Using accelerated ArrayDatatype
root       WARNING  Failed to import gqcnn! Grasp2D functions will not be available.
dexnet.api WARNING  Failed to import DexNetVisualizer3D, visualization methods will be unavailable
test_illegal_create (test.database_test.Hdf5DatabaseTest) ... ok
test_new_database_and_graspable (test.database_test.Hdf5DatabaseTest) ... Input mesh  /home/fattyhu/catkin_ws/src/dex-net/data/test/models/bar_clamp.obj
output mesh  /home/fattyhu/catkin_ws/src/dex-net/.dexnet/bar_clamp_proc.obj
Loading Plugins:
Current Plugins Dir is: /usr/lib/meshlab/plugins 
Error in XMLFile: filter_measure.xml - line: -1, column: -1 - 
Error in XMLFile: filter_mutualinfo.xml - line: -1, column: -1 - 
Total 227 filtering actions
Total 13 io plugins
Opening a file with extention obj
Mesh bar_clamp.obj loaded has 1428 vn 476 fn
No Script to apply.
Mesh /home/fattyhu/catkin_ws/src/dex-net/data/test/models/bar_clamp.obj saved as /home/fattyhu/catkin_ws/src/dex-net/.dexnet/bar_clamp_proc.obj (1428 vn 476 fn)
root       INFO     MeshlabServer Command: meshlabserver -i "data/test/models/bar_clamp.obj" -o ".dexnet/bar_clamp_proc.obj"
Reading data.
Warning: 9 lines were ignored since they did not contain faces or vertices.
Read in 1428 vertices and 476 faces.
Resolution: 0.000716689 with real dimension 0.064502
Center of grid 0 0 0
Bound box size: (-0.0358344 -0.0358344 -0.0358344) to (0.021729 0.02 0.032251) with dimensions 100 100 100.
Computing signed distance field.
Writing results to: .dexnet/bar_clamp_proc.sdf
Processing complete.
root       INFO     SDF Command: SDFGen ".dexnet/bar_clamp_proc.obj" 100 5
root       INFO     Returning datum bar_clamp
root       WARNING  No rendered images of type segmask for stable pose pose_0
root       WARNING  No rendered images of type depth for stable pose pose_0
root       WARNING  No rendered images of type scaled_depth for stable pose pose_0
ok
test_antipodal_grasp_sampler (test.grasping_test.GraspTest) ... root       INFO     Num surface: 30160
root       INFO     21/100 grasps found after iteration 1.
root       INFO     Num surface: 30160
root       INFO     35/100 grasps found after iteration 2.
root       INFO     Num surface: 30160
root       INFO     50/100 grasps found after iteration 3.
root       INFO     Found 50 grasps.
ok
test_contacts (test.grasping_test.GraspTest) ... root       INFO     35/100 grasps found after iteration 1.
root       INFO     61/100 grasps found after iteration 2.
root       INFO     95/100 grasps found after iteration 3.
root       INFO     Found 95 grasps.
ok
test_find_contacts (test.grasping_test.GraspTest) ... ok
test_force_closure (test.grasping_test.GraspTest) ... ok
test_grasp_quality_functions (test.grasping_test.GraspTest) ... root       INFO     27/100 grasps found after iteration 1.
root       INFO     58/100 grasps found after iteration 2.
root       INFO     86/100 grasps found after iteration 3.
root       INFO     Found 86 grasps.
ok
test_init_grasp (test.grasping_test.GraspTest) ... ok
test_init_graspable (test.grasping_test.GraspTest) ... ok
test_init_gripper (test.grasping_test.GraspTest) ... ok
test_min_norm_vector_in_facet (test.grasping_test.GraspTest) ... ok
test_wrench_in_positive_span (test.grasping_test.GraspTest) ... ok
test_gaussian_uniform_alloc (test.learning_test.LearningTest) ... ok
test_thompson_sampling (test.learning_test.LearningTest) ... ok
test_uniform_alloc (test.learning_test.LearningTest) ... ok

----------------------------------------------------------------------
Ran 15 tests in 98.412s

OK
Traceback (most recent call last):
  File "/usr/lib/python2.7/logging/__init__.py", line 861, in emit
    msg = self.format(record)
  File "/usr/lib/python2.7/logging/__init__.py", line 734, in format
    return fmt.format(record)
  File "/usr/local/lib/python2.7/dist-packages/colorlog/colorlog.py", line 112, in format
    record = ColoredRecord(record)
TypeError: 'NoneType' object is not callable
Logged from file core.py, line 454
浮点数例外 (核心已转储)

And when I python apps/dexnet_cli.py. I cannot display the object.

  warnings.warn(warning, RequestsDependencyWarning)
WARNING:root:Unable to import pylibfreenect2. Python-only Kinect driver may not work properly.
WARNING:root:Failed to import ROS in Kinect2_sensor.py. Kinect will not be able to be used in bridged mode
WARNING:root:Unable to import openni2 driver. Python-only Primesense driver may not work properly
WARNING:root:Unable to import pyrealsense2.
WARNING:root:Failed to import ROS in ensenso_sensor.py. ROS functionality not available
WARNING:root:Failed to import ROS in phoxi_sensor.py. PhoXiSensor functionality unavailable.
WARNING:tensorflow:From /home/fattyhu/catkin_ws/src/gqcnn/gqcnn/utils/enums.py:44: The name tf.RunOptions is deprecated. Please use tf.compat.v1.RunOptions instead.

WARNING:tensorflow:From /home/fattyhu/catkin_ws/src/gqcnn/gqcnn/utils/enums.py:44: The name tf.RunOptions is deprecated. Please use tf.compat.v1.RunOptions instead.

OpenGL.acceleratesupport INFO     OpenGL_accelerate module loaded
OpenGL.arrays.arraydatatype INFO     Using accelerated ArrayDatatype
root       WARNING  Failed to import gqcnn! Grasp2D functions will not be available.
dexnet.api WARNING  Failed to import DexNetVisualizer3D, visualization methods will be unavailable
####################################################
DEX-NET 0.1 Command Line Interface
Brought to you by AutoLab, UC Berkeley
####################################################

AVAILABLE COMMANDS:
0) Open a database
1) Open a dataset
2) Display object
3) Display stable poses for object
4) Display grasps for object
5) Generate simulation data for object
6) Compute metadata
7) Display metadata
8) Export objects
9) Set config (advanced)
10) Quit

Enter a numeric command: 0
Enter database name: example
Opened database example.hdf5

Database has one dataset, opened dataset mini_dexnet

AVAILABLE COMMANDS:
0) Open a database
1) Open a dataset
2) Display object
3) Display stable poses for object
4) Display grasps for object
5) Generate simulation data for object
6) Compute metadata
7) Display metadata
8) Export objects
9) Set config (advanced)
10) Quit

Enter a numeric command: 2

Available values:
bar_clamp
climbing_hold
endstop_holder
gearbox
mount1
mount2
nozzle
part1
part3
pawn
pipe_connector
turbine_housing
vase

Enter object key: bar_clamp
dexnet.api INFO     Displaying bar_clamp
Display object failed: global name 'vis' is not defined

AVAILABLE COMMANDS:
0) Open a database
1) Open a dataset
2) Display object
3) Display stable poses for object
4) Display grasps for object
5) Generate simulation data for object
6) Compute metadata
7) Display metadata
8) Export objects
9) Set config (advanced)
10) Quit

Enter a numeric command: 

Can anyone tell me how to fix it? Thanks very much!!! @jeffmahler

RobinSchmid7 commented 4 years ago

I have the same questions - can you help with this @jeffmahler ?

anmakon commented 4 years ago

I had the same error message "Display object failed: global name 'vis' is not defined". In my case, I could not execute line 50 (importing DexNetVisualizer3D as vis) in src/dexnet/api.py. When trying to import it in the python interpreter, I was able to figure out which packages where missing. Hope this helps.

raialonso8 commented 4 years ago

Hi @anmakon , Could you please explain how you get to solve the problem and what packages are missing? Thank you

anmakon commented 4 years ago

Hi @raialonso8,

I don't remember what packages were missing at that stage. I had lots of clashing/missing dependencies in total. To figure out which packages were missing, I ran grep -rnw "whatever-error-message-was-being-displayed" . from the dexnet repo. That showed me in which file and which line the error message was created. Afterwards, I've run that line (in my case from dexnet.visualization import DexNetVisualizer3D as vis) from the python interpreter. Without the try..catch from the original file, it tells you which packages are missing in your system. I guess you could also modify the files a bit/remove the try..catch temporarily to figure out which dependencies you're missing. Hope this helps.

raialonso8 commented 4 years ago

Thanks for the quick answer @anmakon . I really appreciate it I have ran from dexnet.visualization import DexNetVisualizer3D and this is the error message I have got. I cannot see which packages are missing, could you help me?

Python 2.7.12 (default, Apr 15 2020, 17:07:12) [GCC 5.4.0 20160609] on linux2 Type "help", "copyright", "credits" or "license" for more information.

from dexnet.visualization import DexNetVisualizer3D as vis WARNING:root:autolab_core not installed as catkin package, RigidTransform ros methods will be unavailable Unable to import meshrender shared library! Rendering will not work. Likely due to missing Boost.Numpy Boost.Numpy can be installed following the instructions in https://github.com/ndarray/Boost.NumPy /home/rai/.local/lib/python2.7/site-packages/requests/init.py:91: RequestsDependencyWarning: urllib3 (1.25.9) or chardet (2.3.0) doesn't match a supported version! RequestsDependencyWarning) /home/rai/.local/lib/python2.7/site-packages/requests/init.py:83: RequestsDependencyWarning: Old version of cryptography ([1, 2, 3]) may cause slowdown. warnings.warn(warning, RequestsDependencyWarning) WARNING:root:Unable to import pylibfreenect2. Python-only Kinect driver may not work properly. WARNING:root:Unable to import pyrealsense2. WARNING:root:Failed to import ROS in phoxi_sensor.py. PhoXiSensor functionality unavailable. WARNING:tensorflow: The TensorFlow contrib module will not be included in TensorFlow 2.0. For more information, please see: https://github.com/tensorflow/community/blob/master/rfcs/20180907-contrib-sunset.md https://github.com/tensorflow/addons https://github.com/tensorflow/io (for I/O related ops) If you depend on functionality not listed there, please file an issue.

WARNING:tensorflow:From /home/rai/catkin_ws/src/dex-net/deps/gqcnn/gqcnn/utils/enums.py:40: The name tf.RunOptions is deprecated. Please use tf.compat.v1.RunOptions instead.

root WARNING Failed to import gqcnn! Grasp2D functions will not be available. root WARNING Failed to import mayavi root WARNING Failed to import mayavi root WARNING Failed to import mayavi root WARNING Failed to import mayavi root WARNING Failed to import mayavi root WARNING Failed to import mayavi OpenGL.acceleratesupport INFO No OpenGL_accelerate module loaded: No module named OpenGL_accelerate dexnet.api WARNING Failed to import DexNetVisualizer3D, visualization methods will be unavailable Traceback (most recent call last): File "", line 1, in File "/home/rai/catkin_ws/src/dex-net/src/dexnet/visualization/init.py", line 22, in from visualizer2d import DexNetVisualizer2D File "/home/rai/catkin_ws/src/dex-net/src/dexnet/visualization/visualizer2d.py", line 36, in from visualization import Visualizer2D File "/home/rai/catkin_ws/src/dex-net/deps/visualization/visualization/init.py", line 3, in from .visualizer3d import Visualizer3D File "/home/rai/catkin_ws/src/dex-net/deps/visualization/visualization/visualizer3d.py", line 9, in from pyrender import Scene, Mesh, Viewer, Node, MetallicRoughnessMaterial, TextAlign File "/usr/local/lib/python2.7/dist-packages/pyrender-0.1.39-py2.7.egg/pyrender/init.py", line 12, in from .viewer import Viewer File "/usr/local/lib/python2.7/dist-packages/pyrender-0.1.39-py2.7.egg/pyrender/viewer.py", line 36, in class Viewer(pyglet.window.Window): File "_build/bdist.linux-x86_64/egg/pyglet/init.py", line 333, in getattr

File "_build/bdist.linux-x86_64/egg/pyglet/window/init.py", line 129, in

File "/usr/local/lib/python2.7/dist-packages/pyglet-2.0.dev0-py2.7.egg/pyglet/matrix.py", line 78 return matrix @ rmat ^ SyntaxError: invalid syntax

anmakon commented 4 years ago

I haven't encountered the issue that you have here, so I'm afraid I can't really help you solve it. Seems like something within pyglet/pyrender isn't working properly? Maybe it's the version, I've installed pyglet 1.4.0b1 and pyrender 0.1.36 instead.

I should also mention that I never got everything to work with dexnet and just switched to using gqcnn after a couple weeks of frustration. It provided all the functionality that I needed and is significantly easier to install, might be worth a look depending on what you're planning to do.. Good luck!

visatish commented 4 years ago

@raialonso8 Yes, @anmakon is right in that pyglet dropped Python 2.7 compatibility in their most recent releases. I believe the last compatible one is 1.4.10.