lerobot icon indicating copy to clipboard operation
lerobot copied to clipboard

AttributeError: module 'rerun' has no attribute 'init' when running the "Visualize datasets" line specified in README

Open oschan77 opened this issue 9 months ago • 3 comments

System Info

- `lerobot` version: 0.1.0
- Platform: Linux-6.5.0-28-generic-x86_64-with-glibc2.35
- Python version: 3.10.14
- Huggingface_hub version: 0.23.0
- Numpy version: 1.23.1
- PyTorch version (GPU?): 2.3.0+cu121 (True)
- Cuda version: 12010
- Using GPU in script?: No
- Using distributed or parallel set-up in script?: No

Information

  • [X] One of the scripts in the examples/ folder of LeRobot
  • [ ] My own task or dataset (give details below)

Reproduction

  1. Run the "Visualize datasets" line specified in README.
python lerobot/scripts/visualize_dataset.py \
    --repo-id lerobot/pusht \
    --episode-index 0

It gives the following error:

Fetching 222 files: 100%|██████████████████████████████████████████████████████████████████████████████████| 222/222 [00:00<00:00, 377589.41it/s]
Traceback (most recent call last):
  File "/home/ubuntu/lerobot/lerobot/scripts/visualize_dataset.py", line 245, in <module>
    main()
  File "/home/ubuntu/lerobot/lerobot/scripts/visualize_dataset.py", line 241, in main
    visualize_dataset(**vars(args))
  File "/home/ubuntu/lerobot/lerobot/scripts/visualize_dataset.py", line 117, in visualize_dataset
    rr.init(f"{repo_id}/episode_{episode_index}", spawn=spawn_local_viewer)
AttributeError: module 'rerun' has no attribute 'init'

Expected behavior

According to README, it will open rerun.io and display the camera streams, robot states and actions.

oschan77 avatar May 09 '24 02:05 oschan77

That's weird. Can you paste here the result of pip freeze | grep rerun-sdk or poetry show rerun-sdk to see what version you have?

aliberts avatar May 09 '24 15:05 aliberts

That's weird. Can you paste here the result of pip freeze | grep rerun-sdk or poetry show rerun-sdk to see what version you have?

@aliberts I have rerun-sdk==0.15.1.

pip freeze | grep rerun-sdk

rerun-sdk==0.15.1

oschan77 avatar May 10 '24 01:05 oschan77

A few questions to try and narrow it down:

  • Did you install lerobot from a fresh virtual environment with nothing inside?
  • Any chance you also have rerun installed in the venv you are using which would confuse python to import it instead of rerun-sdk when doing import rerun as rr?
  • Can you paste here what is returned by python -c "import rerun; print(rerun.__file__)"? (in your venv)
  • Can you try to downgrade rerun-sdk to something like 0.14.1?

aliberts avatar May 10 '24 15:05 aliberts

@aliberts Thank you so much for your help! Somehow I had another package called "Rerun" installed with "rerun-sdk". Once I uninstalled "Rerun", everything works as expected.

In my case, rerun-sdk==0.15.1 does not account for this issue.

oschan77 avatar May 13 '24 02:05 oschan77