dex-net icon indicating copy to clipboard operation
dex-net copied to clipboard

AttributeError: 'module' object has no attribute 'database_test'

Open benzben opened this issue 6 years ago • 17 comments

After hours of installing dependencies so that the install.sh will finish without errors, the setup.py test returns the error "AttributeError: 'module' object has no attribute 'database_test'". Testing for the database by using

python |>>> import test.database_test

Returns: Traceback (most recent call last): File "", line 1, in File "test/database_test.py", line 27, in import IPython ImportError: No module named IPython

But I installed iPython, 5.1.0.

What's wrong with my installation? I would be glad for some help :-)

benzben avatar Jun 05 '18 11:06 benzben

There is a probably some discrepancy between the Python and ipython installation. This seems to be relevant.

Can you paste the output of:

which python
which ipython

jeffmahler avatar Jun 05 '18 16:06 jeffmahler

@jeffmahler Thanks for your answer. I will have a look at your link, however, the output of these commands return: /usr/bin/python and /usr/local/bin/ipython

Do they have to be located in the same path?

benzben avatar Jun 06 '18 06:06 benzben

database_set

I am module object has no attribute 'database_test' after installing Dex Net 2.0 , Please help.

kundan09 avatar Oct 23 '18 06:10 kundan09

Please see above discussion. Can you paste the output of the following?:

python
|>>> import test.database_test

jeffmahler avatar Nov 16 '18 06:11 jeffmahler

@jeffmahler I exceuted the code in dexnet directory .i.e home/robo/catkin_ws/src/dexnet python test/database_test.py and

i got an error as core dumped, i am installing it on CPU machine. Is the installtion tested on CPU system.

/usr/local/lib/python2.7/dist-packages/pkg_resources/init.py:1241: UserWarning: /home/robo/.cache/Python-Eggs is writable by group/others and vulnerable to attack when used with get_resource_filename. Consider a more secure location (set with .set_extraction_path or the PYTHON_EGG_CACHE environment variable). warnings.warn(msg, UserWarning) No handlers could be found for logger "dexnet.api" test_illegal_create (main.Hdf5DatabaseTest) ... ok test_new_database_and_graspable (main.Hdf5DatabaseTest) ... Loading Plugins: Current Plugins Dir is: /usr/lib/meshlab/plugins Error While parsing the XML filter plugin descriptors: We are trying to load a xml file that does not correspond to any dll or javascript code; please delete all the spurious xml files Total 238 filtering actions Total 12 io plugins Opening a file with extention obj Mesh /home/robo/kundan_ws/src/dex-net/data/test/models/bar_clamp.obj loaded has 1428 vn 476 fn output mesh /home/robo/kundan_ws/src/dex-net/.dexnet/bar_clamp_proc.obj Mesh /home/robo/kundan_ws/src/dex-net/data/test/models/bar_clamp.obj saved as /home/robo/kundan_ws/src/dex-net/.dexnet/bar_clamp_proc.obj (1428 vn 476 fn) INFO:root: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. INFO:root:SDF Command: SDFGen ".dexnet/bar_clamp_proc.obj" 100 5 INFO:root:Returning datum bar_clamp WARNING:root:No rendered images of type segmask for stable pose pose_0 WARNING:root:No rendered images of type depth for stable pose pose_0 WARNING:root:No rendered images of type scaled_depth for stable pose pose_0 ok


Ran 2 tests in 13.787s

OK INFO:rospy.core:signal_shutdown [atexit] Floating point exception (core dumped)

kundan09 avatar Nov 19 '18 13:11 kundan09

@jeffmahler

Output of import test.database_test

Please look into the issue and suggest me the required changes to do.

import test.database_test /usr/local/lib/python2.7/dist-packages/pkg_resources/init.py:1241: UserWarning: /home/robo/.cache/Python-Eggs is writable by group/others and vulnerable to attack when used with get_resource_filename. Consider a more secure location (set with .set_extraction_path or the PYTHON_EGG_CACHE environment variable). warnings.warn(msg, UserWarning) No handlers could be found for logger "dexnet.api"

kundan09 avatar Nov 19 '18 13:11 kundan09

@kundan09 I actually think your tests completed successfully! The error Floating point exception (core dumped) seems to happen on some machines during script termination and is related to matplotlib. I was never able to figure that out, but if it only happens on termination then you're ok.

jeffmahler avatar Nov 19 '18 18:11 jeffmahler

@jeffmahler Is the installtion tested on CPU system ?

kundan09 avatar Nov 20 '18 04:11 kundan09

Hi @jeffmahler,

I am using Ubuntu 16.04 and I am facing a very similar issue. I followed all the steps listed here https://docs.google.com/document/d/1YImq1cBTy9E1n1On6-00gueDT4hfmYJK4uOcxZIzPoY/edit to install dex-net. So far everything works fine. Unfortunately when I am running sudo python setup.py test I have the following log

running test 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 Traceback (most recent call last): File "setup.py", line 42, in test_suite='test' File "/usr/local/lib/python2.7/dist-packages/setuptools/init.py", line 145, in setup return distutils.core.setup(**attrs) File "/usr/lib/python2.7/distutils/core.py", line 151, in setup dist.run_commands() File "/usr/lib/python2.7/distutils/dist.py", line 953, in run_commands self.run_command(cmd) File "/usr/lib/python2.7/distutils/dist.py", line 972, in run_command cmd_obj.run() File "/usr/local/lib/python2.7/dist-packages/setuptools/command/test.py", line 228, in run self.run_tests() File "/usr/local/lib/python2.7/dist-packages/setuptools/command/test.py", line 250, in run_tests exit=False, File "/usr/lib/python2.7/unittest/main.py", line 94, in init self.parseArgs(argv) File "/usr/lib/python2.7/unittest/main.py", line 149, in parseArgs self.createTests() File "/usr/lib/python2.7/unittest/main.py", line 158, in createTests self.module) File "/usr/lib/python2.7/unittest/loader.py", line 130, in loadTestsFromNames suites = [self.loadTestsFromName(name, module) for name in names] File "/usr/lib/python2.7/unittest/loader.py", line 103, in loadTestsFromName return self.loadTestsFromModule(obj) File "/usr/local/lib/python2.7/dist-packages/setuptools/command/test.py", line 54, in loadTestsFromModule tests.append(self.loadTestsFromName(submodule)) File "/usr/lib/python2.7/unittest/loader.py", line 100, in loadTestsFromName parent, obj = obj, getattr(obj, part) AttributeError: 'module' object has no attribute 'database_test'

Reading all the issues carefully, in dex-net folder I run python and then >> import test.database_test and here is the output

WARNING:root:Unable to import pylibfreenect2. Python-only Kinect driver may not work properly. WARNING:root:Unable to import openni2 driver. Python-only Primesense driver may not work properly WARNING:root:Unable to import pyrealsense2. WARNING:trimesh:No FCL -- collision checking will not work root WARNING Failed to import gqcnn! Grasp2D functions will not be available. root WARNING Failed to import mayavi root WARNING Failed to import pyhull 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 dexnet.api WARNING Failed to import DexNetVisualizer3D, visualization methods will be unavailable

exit() rospy.core INFO signal_shutdown [atexit] Floating point exception (core dumped)

I have spent the last days trying to install dex-net on different machines and always the same issue. Any clues?

Thanks

bdenoun avatar Apr 17 '19 14:04 bdenoun

You are missing a dependency required to run the tests. Did you install the dependencies using sudo? That may be causing issues. I highly recommend using a virtualenv and installing all dependencies locally

jeffmahler avatar Apr 17 '19 15:04 jeffmahler

Thank you for your quick reply. Yes I used sudo as specified in the aforementioned document. Let me try going through all the process without using it and come back to you

bdenoun avatar Apr 17 '19 17:04 bdenoun

@jeffmahler So I ran all the same steps except for installing 3rd party dependencies (I had to add --user to the pip instruction in the bash file). Here is the output of python setup.py test

running test 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 WARNING:root:Unable to import CNN modules! Likely due to missing tensorflow. WARNING:root:TensorFlow can be installed following the instructions in https://www.tensorflow.org/get_started/os_setup WARNING:root:Unable to import pylibfreenect2. Python-only Kinect driver may not work properly. WARNING:root:Unable to import openni2 driver. Python-only Primesense driver may not work properly WARNING:root:Unable to import pyrealsense2. WARNING:trimesh:No FCL -- collision checking will not work WARNING:root:Failed to import gqcnn! Grasp2D functions will not be available. WARNING:root:Failed to import mayavi WARNING:root:Failed to import mayavi WARNING:root:Failed to import mayavi WARNING:root:Failed to import mayavi WARNING:root:Failed to import mayavi WARNING:root:Failed to import mayavi WARNING:dexnet.api: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/user/projects/shadow_robot/base/src/dex-net/data/test/models/bar_clamp.obj output mesh /home/user/projects/shadow_robot/base/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/user/projects/shadow_robot/base/src/dex-net/data/test/models/bar_clamp.obj saved as /home/user/projects/shadow_robot/base/src/dex-net/.dexnet/bar_clamp_proc.obj (1428 vn 476 fn) 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. WARNING:root:No rendered images of type segmask for stable pose pose_0 WARNING:root:No rendered images of type depth for stable pose pose_0 WARNING:root:No rendered images of type scaled_depth for stable pose pose_0 ok test_antipodal_grasp_sampler (test.grasping_test.GraspTest) ... ok test_contacts (test.grasping_test.GraspTest) ... 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) ... 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 83.398s

OK Floating point exception (core dumped)

It seems like a lot of tests are OK but it still have this warnings about mayavi, dexnet.api, trimesh and so on (same as before). The weird thing this time is that it doesn't recognize tensorflow but I guess this is another story. Should I worry about those warnings or should I consider the test successful?

Thank you

bdenoun avatar Apr 17 '19 18:04 bdenoun

It looks like the tests passed! You may have problems with visualization due to the failed mayavi import. I would try to re-install it. It's possible that this is related to your computer hardware.

jeffmahler avatar Apr 17 '19 18:04 jeffmahler

Through a pip install or the build?

bdenoun avatar Apr 17 '19 18:04 bdenoun

It is supposed to be installed through pip. I believe that you are probably encountering errors in that process. Unfortunately I can't support mayavi install issues though.

jeffmahler avatar Apr 17 '19 18:04 jeffmahler

Thank you very much for your help! Yes I did using pip and still the same issue but it can be from mayavi (though import mayavi works fine). Can I suggest to maybe modify the linked document with installation instructions so that people don't face the same issue?

bdenoun avatar Apr 17 '19 18:04 bdenoun

Yes, can you add comments / suggestions for your issues to the installation doc?

jeffmahler avatar Apr 17 '19 18:04 jeffmahler