-
Notifications
You must be signed in to change notification settings - Fork 38
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
UFuncTypeError: Cannot cast ufunc 'add' output from dtype('O') to dtype('float64') with casting rule 'same_kind' #69
Comments
the problem is from transition_attention_maps.py predict_fn function where attns[-1].grad is None, however i don't know how to fix it |
see if this solves this issue, #52. let me know if it does not work. |
I am using google colab environment |
版本&环境信息 Version & Environment Information OS: ubuntu 22.04 CUDA version: 11.8.89 |
try |
the thing is paddlepaddle==2.3.2 can't be installed in ubuntu 22.4 and requires ubuntu lower than 20.4. |
This is my code:
`!pip install paddlepaddle-gpu
!git clone https://github.com/PaddlePaddle/InterpretDL.git
import os
import sys
os.chdir(/content/InterpretDL)
sys.path.insert(0, os.getcwd())
import interpretdl as it
!wget -c https://paddle-imagenet-models-name.bj.bcebos.com/dygraph/ViT_base_patch16_224_pretrained.pdparams -P /content/InterpretDL/tutorials/assets/
from tutorials.assets.vision_transformer import ViT_base_patch16_224
paddle_model = ViT_base_patch16_224()
MODEL_PATH = /content/InterpretDL/tutorials/assets/ViT_base_patch16_224_pretrained.pdparams
paddle_model.state_dict(paddle.load(MODEL_PATH))
img_path = /content/InterpretDL/imgs/catdog.jpg
tam = it.TAMInterpreter(paddle_model)
heatmap = tam.interpret(
img_path,
start_layer=4,
label=None, # cat
visual=True,
save_path=None)'
But i keep getting this error:
UFuncTypeError: Cannot cast ufunc 'add' output from dtype('O') to dtype('float64') with casting rule 'same_kind'
why?
The text was updated successfully, but these errors were encountered: