Comments (4)
Thank you for reporting this issue. I've been able to reproduce the bugs on my machine following @y8han. The problem appears to stem from isaacgym overriding the built-in pybind11 registrar of C++ std::vector<std::string>.
This affects all pybind11-based Python libraries that explicitly return a std::vectorstd::string, .e.g pinocchio
.
A temporary workaround involves adjusting the import order to ensure Pinocchio loads before isaacgym. Additionally, since isaacgym needs to be loaded before torch, the recommended import order is:
pinocchio -> isaacgym -> torch
Here's an example of how to structure your imports:
# Other unrelated libraries not depending on pybind11
import other_unrelated_libs
import pinocchio
import isaacgym
import torch
import dex_retargeting
# More unrelated libraries
import more_unrelated_libs
To fix the error in detect_from_video.py
mentioned by @y8han, you can modify the import section as follows:
import pickle
from pathlib import Path
import cv2
import tqdm
import tyro
import pinocchio
import isaacgym
import torch
from dex_retargeting.constants import RobotName, RetargetingType, HandType, get_default_config_path
from dex_retargeting.retargeting_config import RetargetingConfig
from dex_retargeting.seq_retarget import SeqRetargeting
from single_hand_detector import SingleHandDetector
This solution should resolve the immediate issue. However, if anyone discovers a more elegant solution, please feel free to discuss it in this issue thread.
from dex-retargeting.
Could you please provide a detailed script to reproduce this error? I am using isaacgym myself and I do not encounter this error. Here is the screenshot of my terminal command.
Python 3.8.19 (default, Mar 20 2024, 19:58:24)
[GCC 11.2.0] :: Anaconda, Inc. on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import dex_retargeting
>>> import isaacgym
Importing module 'gym_38' (/home/yuzhe/miniconda3/envs/debug/lib/python3.8/site-packages/isaacgym/_bindings/linux-x86_64/gym_38.so)
Setting GYM_USD_PLUG_INFO_PATH to /home/yuzhe/miniconda3/envs/debug/lib/python3.8/site-packages/isaacgym/_bindings/linux-x86_64/usd/plugInfo.json
Or with a different import order:
Python 3.8.19 (default, Mar 20 2024, 19:58:24)
[GCC 11.2.0] :: Anaconda, Inc. on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import isaacgym
Importing module 'gym_38' (/home/yuzhe/miniconda3/envs/debug/lib/python3.8/site-packages/isaacgym/_bindings/linux-x86_64/gym_38.so)
Setting GYM_USD_PLUG_INFO_PATH to /home/yuzhe/miniconda3/envs/debug/lib/python3.8/site-packages/isaacgym/_bindings/linux-x86_64/usd/plugInfo.json
>>> import dex_retargeting
Here is my version of pin and isaacgym
pip3 list | grep isaacgym
isaacgym 1.0rc4
pip3 list | grep pin
pin 2.7.0
from dex-retargeting.
Hi, I encountered the same issue here, and I feel this could be some conflicts between isaacgym simulator and dex-retargeting codebase. For verification, I just added one line import isaacgym
to the python script detect_from_video.py
and run the demo command
python3 detect_from_video.py \
--robot-name allegro \
--video-path data/human_hand_video.mp4 \
--retargeting-type dexpilot \
--hand-type right \
--output-path data/allegro_joints.pkl
Then, I got the same error message
TypeError: No Python class registered for C++ class std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > >
Without importing the isaacgym, this script works fine as expected.
from dex-retargeting.
Thank you for reporting this issue. I've been able to reproduce the bugs on my machine following @y8han. The problem appears to stem from isaacgym overriding the built-in pybind11 registrar of C++
std::vector<std::string>.
This affects all pybind11-based Python libraries that explicitly return a std::vectorstd::string, .e.gpinocchio
.A temporary workaround involves adjusting the import order to ensure Pinocchio loads before isaacgym. Additionally, since isaacgym needs to be loaded before torch, the recommended import order is:
pinocchio -> isaacgym -> torch
Here's an example of how to structure your imports:
# Other unrelated libraries not depending on pybind11 import other_unrelated_libs import pinocchio import isaacgym import torch import dex_retargeting # More unrelated libraries import more_unrelated_libsTo fix the error in
detect_from_video.py
mentioned by @y8han, you can modify the import section as follows:import pickle from pathlib import Path import cv2 import tqdm import tyro import pinocchio import isaacgym import torch from dex_retargeting.constants import RobotName, RetargetingType, HandType, get_default_config_path from dex_retargeting.retargeting_config import RetargetingConfig from dex_retargeting.seq_retarget import SeqRetargeting from single_hand_detector import SingleHandDetectorThis solution should resolve the immediate issue. However, if anyone discovers a more elegant solution, please feel free to discuss it in this issue thread.
This works perfectly on my local machine! Thank you for your quick reply!
from dex-retargeting.
Related Issues (20)
- How To do position retarget like AnyTeleop HOT 6
- hand detection retarget not accurate HOT 6
- Issue running "pip3 install -e ." HOT 1
- Import the new manipulator's URDF HOT 4
- How To do position retarget in real world? HOT 19
- Expand the retargeting algorithm to 2 arm-hand system HOT 1
- teleop on physic simulator to collect data HOT 1
- AttributeError
- Curobo implementation
- Difference bettwenn VectorOptimizer and DexPilotOptimizer HOT 7
- retargetting problem with laptop's built-in camera HOT 7
- some mistake when I install dex-retargeting HOT 1
- Basic Mathmatics about calculating the joint_pos variable in SingleHandDetector.py HOT 2
- install error HOT 3
- How can I retargeting with my hand keypoints as input? HOT 1
- Deployment on physical inspire dexterous hand HOT 1
- Recommended Python Version HOT 2
- position retargeting demo fails when only `*_glb.urdf` is available HOT 3
- using `warm_start` with position optimizer HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from dex-retargeting.