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

Update inference.py #1394

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

Update inference.py #1394

wants to merge 3 commits into from

Conversation

tdktrang
Copy link

@tdktrang tdktrang commented May 18, 2024

Related to DeepLearningExamples/PyTorch/Forecasting/TFT/ (e.g. GNMT/PyTorch or FasterTransformer/All)

Describe the bug
When I run the "inference.py" the error happen because "unscaled_predictions" was numpy.ndarray. Therefore, we need to add the code to process the unscaled_predictions to tensor

To Reproduce
Steps to reproduce the behavior:

python inference.py \
--checkpoint /results/TFT_electricity_bs8x1024_lr1e-3/seed_1/checkpoint.pt \
--data /data/processed/electricity_bin/test.csv \
--tgt_scalers /data/processed/electricity_bin/tgt_scalers.bin \
--cat_encodings /data/processed/electricity_bin/cat_encodings.bin \
--visualize \
--save_predictions

Expected behavior
'numpy.ndarray' object has no attribute 'new_full'

Environment

GPUs in the system: NVIDIA GeForce RTX 3090
CUDA driver version 520.61.05

Related to DeepLearningExamples/PyTorch/Forecasting/TFT/
(e.g. GNMT/PyTorch or FasterTransformer/All)

Describe the bug
When I run the "inference.py" the error happen because "unscaled_predictions" was numpy.ndarray. Therefore, we need to add the code to process the unscaled_predictions to tensor

To Reproduce
Steps to reproduce the behavior:

python inference.py \
--checkpoint /results/TFT_electricity_bs8x1024_lr1e-3/seed_1/checkpoint.pt \
--data /data/processed/electricity_bin/test.csv \
--tgt_scalers /data/processed/electricity_bin/tgt_scalers.bin \
--cat_encodings /data/processed/electricity_bin/cat_encodings.bin \
--visualize \
--save_predictions
Expected behavior
'numpy.ndarray' object has no attribute 'new_full'

Environment

GPUs in the system: NVIDIA GeForce RTX 3090
CUDA driver version 520.61.05
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

Successfully merging this pull request may close these issues.

None yet

2 participants