omron-sinicx / neural-astar

Official implementation of "Path Planning using Neural A* Search" (ICML-21)

Home Page:https://omron-sinicx.github.io/neural-astar

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

An OSerror on Colab

speedhawk opened this issue · comments

Hi, could you please help me to fix the OSerror on Colab when I first time run neural-astar on Colab as the guide said? Many Thanks!

This is the code for downloading checkpoint on the Colab example you shared in README:

import torch
from neural_astar.planner import NeuralAstar, VanillaAstar
from neural_astar.utils.training import load_from_ptl_checkpoint  # the error line

device = "cuda" if torch.cuda.is_available() else "cpu"

neural_astar = NeuralAstar(encoder_arch='CNN').to(device)
neural_astar.load_state_dict(load_from_ptl_checkpoint("../model/mazes_032_moore_c8/lightning_logs/version_0/checkpoints/epoch=33-step=272.ckpt"))

vanilla_astar = VanillaAstar().to(device)

The given error, which I never met, is below:

OSError: /usr/local/lib/python3.10/dist-packages/torchaudio/lib/libtorchaudio.so: undefined symbol: _ZN2at4_ops5zeros4callEN3c108ArrayRefINS2_6SymIntEEENS2_8optionalINS2_10ScalarTypeEEENS6_INS2_6LayoutEEENS6_INS2_6DeviceEEENS6_IbEE

In comparison with the outputs in the example:

/home/yonetani/programs/omron-sinicx/neural-astar/.venv/lib/python3.9/site-packages/tqdm/auto.py:22: TqdmWarning: IProgress not found. Please update jupyter and ipywidgets. See https://ipywidgets.readthedocs.io/en/stable/user_install.html
  from .autonotebook import tqdm as notebook_tqdm
load ../model/mazes_032_moore_c8/lightning_logs/version_0/checkpoints/epoch=33-step=272.ckpt

The path format is really similar to that in Ubuntu. Is that meaning you can connect Colab into Ubuntu virual machine? I am really a newer of Ubuntu and hope that you can help me to fix this OSerror. Many thanks!

Hi! Thank you for reporting the issue.
It seems like there is a problem around torchaudio as discussed in pytorch/audio#2532.
As neural astar does not depend on torchaudio, can you just uninstall it via pip uninstall -y torchaudio to solve the problem?

Closed as I confirmed that uninstalling torchaudio resolved the issue.

Hi, I am sorry to reply you so late. Thank you for your useful advice and I have fixed it before you reply^_^. The OSerror indeedly happened because of the 'torchaudio' package but the essential reason causing this exception is the compatibility of old version PyTorch. It can be fixed by re-installed torchaudio with the special version suitable with Pytorch 1.12.1.