We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Description TypeError: can't convert cuda:0 device type tensor to numpy. Use Tensor.cpu() to copy the tensor to host memory first.
in tft_explainer.py:211 -> can be fixed with attention_heads = self.model.model._attn_out_weights.detach().cpu().numpy().sum(axis=-2)
attention_heads = self.model.model._attn_out_weights.detach().cpu().numpy().sum(axis=-2)
another TypeError occurs in tft_explainer.py:506
To Reproduce When executing darts/examples/13-TFT-examples.ipynb, without any modifications.
In particular the following line causes the error. explainability_result = explainer.explain()
explainability_result = explainer.explain()
System:
The text was updated successfully, but these errors were encountered:
Hi @studentangerer, this is indeed a bug when running TFTModel on GPU. We'll fix this soon.
As a hotfix, you could save the model and then load it to cpu:
model.save("my_model.pt") model_cpu = TFTModel.load("my_model.pt", map_location="cpu") model_cpu.to_cpu() explainer = TFTExplainer(model_cpu)
After that the explainer should work as expected.
Sorry, something went wrong.
Successfully merging a pull request may close this issue.
Description
TypeError: can't convert cuda:0 device type tensor to numpy. Use Tensor.cpu() to copy the tensor to host memory first.
in tft_explainer.py:211 -> can be fixed with
attention_heads = self.model.model._attn_out_weights.detach().cpu().numpy().sum(axis=-2)
another TypeError occurs in tft_explainer.py:506
To Reproduce
When executing darts/examples/13-TFT-examples.ipynb, without any modifications.
In particular the following line causes the error.
explainability_result = explainer.explain()
System:
The text was updated successfully, but these errors were encountered: