Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AttributeError: 'SequenceDataset' object has no attribute '_hdf5_file' #201

Open
TousakaNagio opened this issue Oct 21, 2024 · 1 comment

Comments

@TousakaNagio
Copy link

Exception ignored in: <function SequenceDataset.del at 0x7f6ed46b2a70>
Traceback (most recent call last):
File "/home/shinji106/ntu/robocasa/robomimic/robomimic/utils/dataset.py", line 307, in del
self.close_and_delete_hdf5_handle()
File "/home/shinji106/ntu/robocasa/robomimic/robomimic/utils/dataset.py", line 291, in close_and_delete_hdf5_handle
if self._hdf5_file is not None:
AttributeError: 'SequenceDataset' object has no attribute '_hdf5_file'
run failed with error:
expected str, bytes or os.PathLike object, not list

Traceback (most recent call last):
File "/home/shinji106/ntu/robocasa/robomimic/robomimic/scripts/train.py", line 483, in main
train(config, device=device, eval_only=args.eval_only)
File "/home/shinji106/ntu/robocasa/robomimic/robomimic/scripts/train.py", line 187, in train
trainset, validset = TrainUtils.load_data_for_training(
File "/home/shinji106/ntu/robocasa/robomimic/robomimic/utils/train_utils.py", line 137, in load_data_for_training
train_dataset = dataset_factory(
File "/home/shinji106/ntu/robocasa/robomimic/robomimic/utils/train_utils.py", line 197, in dataset_factory
dataset = get_dataset(
File "/home/shinji106/ntu/robocasa/robomimic/robomimic/utils/train_utils.py", line 231, in get_dataset
ds_list.append(ds_class(**ds_kwargs_copy))
File "/home/shinji106/ntu/robocasa/robomimic/robomimic/utils/dataset.py", line 105, in init
self.hdf5_path = os.path.expanduser(hdf5_path)
File "/home/shinji106/miniconda3/envs/robocasa/lib/python3.10/posixpath.py", line 232, in expanduser
path = os.fspath(path)
TypeError: expected str, bytes or os.PathLike object, not list

I run into several issues when I am trying to run the training script of bc_transformer on robocasa. How can I solve these issues?

@TousakaNagio
Copy link
Author

TousakaNagio commented Oct 22, 2024

The title error occurs due to the error of TypeError: expected str, bytes or os.PathLike object, not list.
I am still wondering why the generated training config contains a list of path to the dataset:

image

I am wondering why the generated config contains a list of paths.
If I replace it with a path, the second error occurs:

Traceback (most recent call last):
File "/home/shinji106/ntu/robocasa/robomimic/robomimic/scripts/train.py", line 482, in main
train(config, device=device, eval_only=args.eval_only)
File "/home/shinji106/ntu/robocasa/robomimic/robomimic/scripts/train.py", line 186, in train
trainset, validset = TrainUtils.load_data_for_training(
File "/home/shinji106/ntu/robocasa/robomimic/robomimic/utils/train_utils.py", line 137, in load_data_for_training
train_dataset = dataset_factory(
File "/home/shinji106/ntu/robocasa/robomimic/robomimic/utils/train_utils.py", line 197, in dataset_factory
dataset = get_dataset(
File "/home/shinji106/ntu/robocasa/robomimic/robomimic/utils/train_utils.py", line 231, in get_dataset
ds_list.append(ds_class(**ds_kwargs_copy))
File "/home/shinji106/ntu/robocasa/robomimic/robomimic/utils/dataset.py", line 145, in init
self.load_demo_info(filter_by_attribute=self.filter_by_attribute)
File "/home/shinji106/ntu/robocasa/robomimic/robomimic/utils/dataset.py", line 207, in load_demo_info
self.demos = [elem.decode("utf-8") for elem in np.array(self.hdf5_file["mask/{}".format(filter_by_attribute)][:])]
File "h5py/_objects.pyx", line 54, in h5py._objects.with_phil.wrapper
File "h5py/_objects.pyx", line 55, in h5py._objects.with_phil.wrapper
File "/home/shinji106/miniconda3/envs/robocasa/lib/python3.10/site-packages/h5py/_hl/dataset.py", line 804, in getitem
mtype = h5t.py_create(new_dtype)
File "h5py/h5t.pyx", line 1669, in h5py.h5t.py_create
File "h5py/h5t.pyx", line 1693, in h5py.h5t.py_create
File "h5py/h5t.pyx", line 1731, in h5py.h5t.py_create
File "h5py/h5t.pyx", line 1544, in h5py.h5t._c_string
ValueError: Size must be positive (size must be positive)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant