Instructions to use JSHNSL/cyclo-intelligence-patches with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- LeRobot
How to use JSHNSL/cyclo-intelligence-patches with LeRobot:
- Notebooks
- Google Colab
- Kaggle
cyclo_intelligence ํจ์น โ Diffusion / VQ-BeT ์ ์ฑ ์ด ์ ๋์๊ฐ๋ ๋ฌธ์
ROBOTIS cyclo_intelligence ์์ DiffusionยทVQ-BeT ์ ์ฑ ์ ๋ฐฐํฌํ๋ฉด ๋ก๋ด์ด ์์ง์ด์ง ์๋๋ค. ACT๋ ์ ์ ๋์ํ๋ค. ๊ทธ ์์ธ๊ณผ ์์ ๋ณธ์ด๋ค.
๊ธฐ์ค ์ปค๋ฐ: 8065dfc (2026-07-10, ROBOTIS-GIT/cyclo_intelligence main)
ํ ์ค ์ ์ฉ
curl -fsSL https://huggingface.co/JSHNSL/cyclo-intelligence-patches/resolve/main/apply_patches.sh | bash
VQ-BeT๊น์ง ์ฐ๋ ค๋ฉด (์น UI ์ฌ๋น๋ ํฌํจ):
curl -fsSL https://huggingface.co/JSHNSL/cyclo-intelligence-patches/resolve/main/apply_patches.sh | WITH_UI=yes bash
cyclo_intelligence ๊ฐ
~/cyclo_intelligence๊ฐ ์๋๋ฉด:CYCLO_INTELLIGENCE_DIR=/๊ฒฝ๋ก bash apply_patches.sh์คํฌ๋ฆฝํธ๋ ๋ฐฑ์ (*.bak)์ ๋ง๋ค๊ณ , ์ด๋ฏธ ์ ์ฉ๋์ผ๋ฉด ๊ฑด๋๋ด๋ค.
๋ฌด์์ด ๋ฌธ์ ์๋
โ ์์ง์ด ํ ๊ธฐ๋ฐ ์ ์ฑ ์ ์ง์ ํธ์ถํ๋ค (ํต์ฌ)
lerobot_engine/prediction.py ๋ ์ ์ฑ
์ถ๋ก ์ ์ด๋ ๊ฒ ํ๋ค:
action = self._policy.predict_action_chunk(batch) # ์ง์ ํธ์ถ
๊ทธ๋ฐ๋ฐ Diffusion๊ณผ VQ-BeT์ predict_action_chunk ๋ ๋จ๋
ํธ์ถ์ด ๋ถ๊ฐ๋ฅํ๋ค.
๋ด๋ถ observation ํ(self._queues)๋ฅผ stackํ๋๋ฐ, ๊ทธ ํ๋ฅผ ์ฑ์ฐ๋ ๊ฑด select_action ๋ฟ์ด๊ธฐ ๋๋ฌธ์ด๋ค:
# lerobot/policies/diffusion/modeling_diffusion.py
def predict_action_chunk(self, batch, noise=None):
# stack n latest observations from the queue
batch = {k: torch.stack(list(self._queues[k]), dim=1) for k in batch if k in self._queues}
ํ๊ฐ ๋น์ด ์์ผ๋:
RuntimeError: stack expects a non-empty TensorList
โ get_action ์คํจ โ ์ก์
์ด ๋ฐํ๋์ง ์์ โ ๋ก๋ด์ด ์ ์์ง์ธ๋ค.
ACT๋ n_obs_steps=1 ์ด๋ผ ํ๋ฅผ ์ ์ด๋ค. ๊ทธ๋์ ACT๋ง ๋ฉ์ฉกํ๋ ๊ฒ์ด๋ค.
๊ธฐ์กด fallback์ except (NotImplementedError, AttributeError) ๋ง ์ก์์ RuntimeError ๋ฅผ ๋ชป ๊ฑธ๋ ๋ค.
์์ : ํ ๊ธฐ๋ฐ ์ ์ฑ
์ predict_action_chunk ๋ฅผ ์์ ๊ฑด๋๋ฐ๊ณ select_action ์ผ๋ก ๋ผ์ฐํ
ํ๋ค.
_QUEUE_BASED_POLICIES = {"VQBeTPolicy", "DiffusionPolicy"}
def _predict_chunk(self, batch):
if type(self._policy).__name__ in self._QUEUE_BASED_POLICIES:
return self._select_action_chunk(batch) # ํ๋ฅผ ์ฑ์ฐ๋ ๊ฒฝ๋ก
try:
...
except (NotImplementedError, AttributeError, RuntimeError, AssertionError):
return self._select_action_chunk(batch) # ์์ ๋ง
โก diffusers ๊ฐ ์ถ๋ก ์ปจํ
์ด๋์ ์๋ค
Diffusion ์ ์ฑ
์ด ์๊ตฌํ๋ค. lerobot_server ์ปจํ
์ด๋์ pip ์ด ์๊ณ uv ๋ฅผ ์ด๋ค:
docker exec lerobot_server sh -c 'VIRTUAL_ENV=/lerobot/.venv uv pip install diffusers'
pip install์No module named pip์ผ๋ก ์คํจํ๋ค.
โข ์น UI ๋๋กญ๋ค์ด์ VQ-BeT์ด ์๋ค (VQ-BeT๋ง ํด๋น)
๋ฐฑ์๋๋ vqbet์ ์ง์ํ๋๋ฐ UI ๋ชฉ๋ก์ ํญ๋ชฉ์ด ์๋ค. ํ ์ค ์ถ๊ฐ + ์ฌ๋น๋๊ฐ ํ์ํ๋ค.
โ ๏ธ
./docker/container.sh build-ui๋ ์คํจํ๋ค. npm์ ํธ์คํธ uid๋ก ๋๋ฆฌ๋๋ฐ UI๊ฐ ์ปจํ ์ด๋/root/๋ฐ์ด๋ผ permission denied๊ฐ ๋๊ณ , ๊ทธ๊ฒ ์๋ฑํ๊ฒ "no lockfile" ์๋ฌ๋ก ๋ณด๊ณ ๋๋ค. root๋ก ์ง์ ๋น๋ํด์ผ ํ๋ค (์คํฌ๋ฆฝํธ๊ฐ ๊ทธ๋ ๊ฒ ํ๋ค).
ํ์ผ
| ํ์ผ | ๋ด์ฉ |
|---|---|
apply_patches.sh |
์ ๋ถ ์ ์ฉํ๋ ์คํฌ๋ฆฝํธ |
prediction.py |
ํจ์น๋ ์์ง โ cyclo_brain/policy/lerobot/lerobot_engine/prediction.py |
InferenceModelSelector.js |
VQ-BeT ํญ๋ชฉ ์ถ๊ฐ โ orchestrator/ui/src/components/InferenceModelSelector.js |
prediction.diff / ui.diff |
์๋ณธ ๋๋น ๋ณ๊ฒฝ๋ถ (๊ฒํ ์ฉ) |
์๋ ์ ์ฉ
CI=~/cyclo_intelligence
BASE=https://huggingface.co/JSHNSL/cyclo-intelligence-patches/resolve/main
# โ ์์ง ํจ์น
cp "$CI/cyclo_brain/policy/lerobot/lerobot_engine/prediction.py"{,.bak}
curl -fsSL "$BASE/prediction.py" -o "$CI/cyclo_brain/policy/lerobot/lerobot_engine/prediction.py"
# โก diffusers (Diffusion ์ธ ๋๋ง)
docker exec lerobot_server sh -c 'VIRTUAL_ENV=/lerobot/.venv uv pip install diffusers'
# โข ์ฌ์์
docker restart lerobot_server
VQ-BeT๋ ์ฐ๋ ค๋ฉด ์ถ๊ฐ๋ก:
cp "$CI/orchestrator/ui/src/components/InferenceModelSelector.js"{,.bak}
curl -fsSL "$BASE/InferenceModelSelector.js" -o "$CI/orchestrator/ui/src/components/InferenceModelSelector.js"
CID=$(docker ps -qf name=cyclo_intelligence)
UID_D=/root/ros2_ws/src/cyclo_intelligence/orchestrator/ui
docker exec -w "$UID_D" "$CID" bash -lc "npm ci --legacy-peer-deps"
docker exec -w "$UID_D" "$CID" bash -lc "npm run build"
docker exec "$CID" sh -c "cp -a $UID_D/build/. /usr/share/nginx/html/ && nginx -s reload"
# ๋ธ๋ผ์ฐ์ ๊ฐ๋ ฅ ์๋ก๊ณ ์นจ (Ctrl+Shift+R)
ํ์ธ
# ์์ง์ ํจ์น๊ฐ ์ด์์๋
docker exec lerobot_server sh -c 'grep -n _QUEUE_BASED_POLICIES /app/lerobot_engine/prediction.py'
# ์ถ๋ก ์ค ๋ก๊ทธ
docker logs -f lerobot_server
RuntimeError: stack expects a non-empty TensorList๊ฐ ์ ๋์ค๋ฉด ์ฑ๊ณตAction chunk: T=..., D=...๊ฐ ๋ฐ๋ณต๋๋ฉด ์ก์ ์ด ๋๊ฐ๋ ์ค
๋๋๋ฆฌ๊ธฐ
mv <ํ์ผ>.bak <ํ์ผ>
docker restart lerobot_server
์ฃผ์
prediction.py๋ ํธ์คํธ ํ์ผ์ด๊ณ ์ปจํ ์ด๋์ read-only ๋ง์ดํธ๋๋ค โ ํธ์คํธ์์ ๊ณ ์น๊ณ ์ฌ์์ํด์ผ ๋ฐ์๋๋ค.diffusers์ค์น๋ ์ปจํ ์ด๋์ writable layer์ ๋ค์ด๊ฐ๋ค.docker restart๋ ์ ์ง๋์ง๋ง ์ปจํ ์ด๋๋ฅผ ์ฌ์์ฑ(--force-recreate,docker rm)ํ๋ฉด ์ฌ๋ผ์ง๋ค โ ๋ค์ ์ค์นํด์ผ ํ๋ค.- cyclo_intelligence ๊ฐ ์
๋ฐ์ดํธ๋๋ฉด
prediction.py๊ฐ ๋ฎ์ด์จ์ง ์ ์๋ค โ ๊ทธ๋ ๋ค์ ์ ์ฉํ๋ค.
๊ด๋ จ
- ์ ์ฒด ํ์ต ํ์ดํ๋ผ์ธ (Isaac Sim โ LeRobot โ ํ์ต โ ๋ฐฐํฌ): JSHNSL/humanoid-imitation-learning
- upstream: ROBOTIS-GIT/cyclo_intelligence