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

Eval.py script error #1

Open
BY-Chai opened this issue Dec 27, 2024 · 0 comments
Open

Eval.py script error #1

BY-Chai opened this issue Dec 27, 2024 · 0 comments

Comments

@BY-Chai
Copy link

BY-Chai commented Dec 27, 2024

The evaluation script has an indexing error, when executing it after training.

The evaluation is executed using the following series of commands:

cd ./scripts
python hdf5.py --dataset pi_tcn --history_length 20 --unroll_length 10
python train.py --batch_size 1024 --model_type tcn --history_length 20 --unroll_length 10 --predictor_type velocity
python train.py --batch_size 1024 --model_type tcn --history_length 20 --unroll_length 10 --predictor_type attitude
python.eval.py

The error message after eval.py is

Parsing arguments ...
Seed set to 10
/home/user/Documents/longhorizondynamicsrepo/src/FW-DYNAMICS_LEARNING/resources/experiments/20241225-233641_1/
Testing Dynamics model: /home/lpenguin/Documents/UTAT/Rao2024/src/FW-DYNAMICS_LEARNING/resources/experiments/20241225-233641_1/checkpoints/model-epoch=81-val_loss=0.00.pth
Loading arguments ...
Generating test data ...
Traceback (most recent call last):
  File "eval.py", line 114, in <module>
    main(args, hdf5_files, model_path)
  File "eval.py", line 27, in main
    test_dataloaders = [load_dataset("test", data_path, hdf5_file, args, 0, False)[1] for hdf5_file in hdf5_files] # load_dataset(mode, data_path, hdf5_file, args, num_workers, pin_memory)
  File "eval.py", line 27, in <listcomp>
    test_dataloaders = [load_dataset("test", data_path, hdf5_file, args, 0, False)[1] for hdf5_file in hdf5_files] # load_dataset(mode, data_path, hdf5_file, args, num_workers, pin_memory)
  File "/home/lpenguin/Documents/UTAT/Rao2024/src/FW-DYNAMICS_LEARNING/scripts/dynamics_learning/data.py", line 44, in load_dataset
    dataset = DynamicsDataset(data_path, hdf5_file, args)
  File "/home/lpenguin/Documents/UTAT/Rao2024/src/FW-DYNAMICS_LEARNING/scripts/dynamics_learning/data.py", line 22, in __init__
    self.state_len = self.X_shape[2] - 4 # State vector doesn't contain control inputs, so decrement
IndexError: tuple index out of range

Package versions installed via requirements.txt:
numpy==1.24.3
matplotlib==3.7.5
pandas==2.0.3
scipy==1.10.1
scikit-learn==1.3.2
h5py==3.11.0
pytorch==2.3.1 (with CUDA 12.1)
lightning==2.3
Additionally, I installed the following, which was required but not listed in requirements.txt
wandb==0.19.1

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