paddlepaddle / interpretdl Goto Github PK
View Code? Open in Web Editor NEWInterpretDL: Interpretation of Deep Learning Models,基于『飞桨』的模型可解释性算法库。
Home Page: https://interpretdl.readthedocs.io
License: Apache License 2.0
InterpretDL: Interpretation of Deep Learning Models,基于『飞桨』的模型可解释性算法库。
Home Page: https://interpretdl.readthedocs.io
License: Apache License 2.0
请问目前有关于分割模型可视化的热力图方法吗,
我使用gradcam的教程在自己网络尝试,
显示我的维度不对,不知道该怎么处理。
你好,同是厂内开发人员,尝试用这个工具,跑了代码库里的InterpretDL/tutorials/normlime_tutorial_nlp.ipynb
,模型数据都下好了,跑的时候报错,不知道具体是什么意思,求指教
total of 1200 sentences
0%| | 0/1200 [00:00<?, ?it/s]2020-12-18 11:44:57,011-WARNING: /Users/wanghao81/senta_model/bilstm_model/params/checkpoint.pdparams not found, try to load model file saved with [ save_params, save_persistables, save_vars ]
2020-12-18 11:44:57,211-WARNING: /Users/wanghao81/senta_model/bilstm_model/params.pdparams not found, try to load model file saved with [ save_params, save_persistables, save_vars ]
2020-12-18 11:44:57,211-WARNING: variable file [ /Users/wanghao81/senta_model/bilstm_model/params/learning_rate_0 /Users/wanghao81/senta_model/bilstm_model/params/lstm_0.b_0_moment_0 /Users/wanghao81/senta_model/bilstm_model/params/fc_2.b_0_moment_0 /Users/wanghao81/senta_model/bilstm_model/params/fc_0.b_0_moment_0 /Users/wanghao81/senta_model/bilstm_model/params/embedding_0.w_0_moment_0 /Users/wanghao81/senta_model/bilstm_model/params/lstm_1.w_0_moment_0 /Users/wanghao81/senta_model/bilstm_model/params/fc_0.w_0_moment_0 /Users/wanghao81/senta_model/bilstm_model/params/fc_3.w_0_moment_0 /Users/wanghao81/senta_model/bilstm_model/params/fc_1.b_0_moment_0 /Users/wanghao81/senta_model/bilstm_model/params/fc_1.w_0_moment_0 /Users/wanghao81/senta_model/bilstm_model/params/fc_3.b_0_moment_0 /Users/wanghao81/senta_model/bilstm_model/params/lstm_1.b_0_moment_0 /Users/wanghao81/senta_model/bilstm_model/params/fc_2.w_0_moment_0 /Users/wanghao81/senta_model/bilstm_model/params/lstm_0.w_0_moment_0 ] not used
Load model from /Users/wanghao81/senta_model/bilstm_model/params
4%|▍ | 52/1200 [00:03<01:09, 16.61it/s]
Traceback (most recent call last):
File "/Users/wanghao81/InterpretDL/tutorials/test.py", line 67, in
batch_size=10)
File "/Users/wanghao81/InterpretDL/interpretdl/interpreter/_normlime_base.py", line 400, in interpret
auto_save=(i % 10) == 0)
File "/Users/wanghao81/InterpretDL/interpretdl/interpreter/_normlime_base.py", line 271, in _get_lime_weights
batch_size=batch_size)
File "/Users/wanghao81/InterpretDL/interpretdl/interpreter/lime.py", line 342, in interpret
probability = self.predict_fn(*self.model_inputs)[0]
File "/Users/wanghao81/InterpretDL/interpretdl/interpreter/lime.py", line 417, in predict_fn
for i, d in enumerate(params)})
File "/Users/wanghao81/opt/anaconda3/envs/paddle_env/lib/python3.6/site-packages/paddle/fluid/executor.py", line 1071, in run
six.reraise(*sys.exc_info())
File "/Users/wanghao81/opt/anaconda3/envs/paddle_env/lib/python3.6/site-packages/six.py", line 703, in reraise
raise value
File "/Users/wanghao81/opt/anaconda3/envs/paddle_env/lib/python3.6/site-packages/paddle/fluid/executor.py", line 1066, in run
return_merged=return_merged)
File "/Users/wanghao81/opt/anaconda3/envs/paddle_env/lib/python3.6/site-packages/paddle/fluid/executor.py", line 1154, in _run_impl
use_program_cache=use_program_cache)
File "/Users/wanghao81/opt/anaconda3/envs/paddle_env/lib/python3.6/site-packages/paddle/fluid/executor.py", line 1229, in _run_program
fetch_var_name)
paddle.fluid.core_avx.EnforceNotMet:
0 std::string paddle::platform::GetTraceBackString<std::string const&>(std::string const&&&, char const*, int)
1 void paddle::operators::math::CopyValidData(paddle::framework::Tensor*, paddle::framework::Tensor const*, paddle::framework::CPUVector const&, int, int, bool, paddle::operators::math::CopyType, paddle::operators::math::PadLayout)
2 paddle::operators::math::UnpaddingLoDTensorFunctor<paddle::platform::CPUDeviceContext, float>::operator()(paddle::platform::CPUDeviceContext const&, paddle::framework::LoDTensor const&, paddle::framework::LoDTensor*, int, int, bool, paddle::operators::math::PadLayout)
3 paddle::operators::SequenceUnpadOpKernel<paddle::platform::CPUDeviceContext, float>::Compute(paddle::framework::ExecutionContext const&) const
4 std::__1::__function::__func<paddle::framework::OpKernelRegistrarFunctor<paddle::platform::CPUPlace, false, 0ul, paddle::operators::SequenceUnpadOpKernel<paddle::platform::CPUDeviceContext, float>, paddle::operators::SequenceUnpadOpKernel<paddle::platform::CPUDeviceContext, double>, paddle::operators::SequenceUnpadOpKernel<paddle::platform::CPUDeviceContext, int>, paddle::operators::SequenceUnpadOpKernel<paddle::platform::CPUDeviceContext, long long> >::operator()(char const*, char const*, int) const::'lambda'(paddle::framework::ExecutionContext const&), std::__1::allocator<paddle::framework::OpKernelRegistrarFunctor<paddle::platform::CPUPlace, false, 0ul, paddle::operators::SequenceUnpadOpKernel<paddle::platform::CPUDeviceContext, float>, paddle::operators::SequenceUnpadOpKernel<paddle::platform::CPUDeviceContext, double>, paddle::operators::SequenceUnpadOpKernel<paddle::platform::CPUDeviceContext, int>, paddle::operators::SequenceUnpadOpKernel<paddle::platform::CPUDeviceContext, long long> >::operator()(char const*, char const*, int) const::'lambda'(paddle::framework::ExecutionContext const&)>, void (paddle::framework::ExecutionContext const&)>::operator()(paddle::framework::ExecutionContext const&)
5 paddle::framework::OperatorWithKernel::RunImpl(paddle::framework::Scope const&, paddle::platform::Place const&, paddle::framework::RuntimeContext*) const
6 paddle::framework::OperatorWithKernel::RunImpl(paddle::framework::Scope const&, paddle::platform::Place const&) const
7 paddle::framework::OperatorBase::Run(paddle::framework::Scope const&, paddle::platform::Place const&)
8 paddle::framework::Executor::RunPartialPreparedContext(paddle::framework::ExecutorPrepareContext*, paddle::framework::Scope*, long long, long long, bool, bool, bool)
9 paddle::framework::Executor::Run(paddle::framework::ProgramDesc const&, paddle::framework::Scope*, int, bool, bool, std::__1::vector<std::string, std::__1::allocator<std::string > > const&, bool, bool)
10 void pybind11::cpp_function::initialize<paddle::pybind::pybind11_init_core_avx(pybind11::module&)::$_111, void, paddle::framework::Executor&, paddle::framework::ProgramDesc const&, paddle::framework::Scope*, int, bool, bool, std::__1::vector<std::string, std::__1::allocator<std::string > > const&, pybind11::name, pybind11::is_method, pybind11::sibling>(paddle::pybind::pybind11_init_core_avx(pybind11::module&)::$_111&&, void ()(paddle::framework::Executor&, paddle::framework::ProgramDesc const&, paddle::framework::Scope, int, bool, bool, std::__1::vector<std::string, std::__1::allocator<std::string > > const&), pybind11::name const&, pybind11::is_method const&, pybind11::sibling const&)::'lambda'(pybind11::detail::function_call&)::__invoke(pybind11::detail::function_call&)
11 pybind11::cpp_function::dispatcher(_object*, _object*, _object*)
File "/Users/wanghao81/opt/anaconda3/envs/paddle_env/lib/python3.6/site-packages/paddle/fluid/framework.py", line 2610, in append_op
attrs=kwargs.get("attrs", None))
File "/Users/wanghao81/opt/anaconda3/envs/paddle_env/lib/python3.6/site-packages/paddle/fluid/layer_helper.py", line 43, in append_op
return self.main_program.current_block().append_op(*args, **kwargs)
File "/Users/wanghao81/opt/anaconda3/envs/paddle_env/lib/python3.6/site-packages/paddle/fluid/layers/sequence_lod.py", line 1057, in sequence_unpad
outputs={'Out': out})
File "/Users/wanghao81/InterpretDL/tutorials/assets/bilstm.py", line 106, in bilstm
emb = fluid.layers.sequence_unpad(emb, length=seq_len)
File "/Users/wanghao81/InterpretDL/tutorials/test.py", line 36, in paddle_model
probs = bilstm(word_ids, seq_len, None, DICT_DIM, is_prediction=True)
File "/Users/wanghao81/InterpretDL/interpretdl/interpreter/lime.py", line 392, in _paddle_prepare
probs = self.paddle_model(*data_ops)
File "/Users/wanghao81/InterpretDL/interpretdl/interpreter/lime.py", line 340, in interpret
self._paddle_prepare()
File "/Users/wanghao81/InterpretDL/interpretdl/interpreter/_normlime_base.py", line 271, in _get_lime_weights
batch_size=batch_size)
File "/Users/wanghao81/InterpretDL/interpretdl/interpreter/_normlime_base.py", line 400, in interpret
auto_save=(i % 10) == 0)
File "/Users/wanghao81/InterpretDL/tutorials/test.py", line 67, in
batch_size=10)
Error: The padded sequence length can not be less than its original length.
[Hint: Expected pad_seq_len >= valid_seq_len, but received pad_seq_len:256 < valid_seq_len:278.] at (/home/teamcity/work/ef54dc8a5b211854/paddle/fluid/operators/math/sequence_padding.cc:38)
[operator < sequence_unpad > error]
Process finished with exit code 1
An interface for using the explanation algorithms in InterpretDL.
Much easier to use.
Hi, my name is Matt Cremeens and am interested in using your work for a research project.
Error upon installation
Steps to reproduce the behavior:
If you have a code sample, error messages, stack traces, please provide it here as well.
Failed to build numpy
ERROR: Could not build wheels for numpy, which is required to install pyproject.toml-based projects
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
error: subprocess-exited-with-error
× pip subprocess to install build dependencies did not run successfully.
If you know well the environment of your machine, please put the information below:
macOS
python3.9
Score-CAM is a new gradient-free variant of CAMs. Is there any interest to implement it in Paddle?
Paper: Score-CAM
Pytorch Code:Implementation
(optional) Briefly introduce yourself.
---请问有Grad-CAM可视化分割模型的时间安排吗?
location: https://github.com/PaddlePaddle/InterpretDL/blob/master/tutorials/GradCAM_Segmentation.ipynb
in funciton GradCAMSegInterpreter._build_predict_fn( ).predict_fn( ) :
# paddle gradient computation changes since 2.4
paddle_version=tuple(map(int, paddle.__version__.split(".")))
if paddle_version>=(2,4,0):
loss.backward(retain_graph=True) #since paddle 2.4
gradients = paddle.grad(
outputs=[target], inputs=[self._feature_maps[self._target_layer_name]])[0]
else:
oss.backward()
gradients = self._feature_maps[self._target_layer_name].grad
error: target is not defined,it should be loss
训练好了paddledetection模型,怎么使用interpretDL进行可视化?
(optional) Briefly introduce yourself.
运行example_grad_cam_cv.ipynb时会报错
Steps to reproduce the behavior:
---------------------------------------------------------------------------
AxisError Traceback (most recent call last)
/paddle/temp/ipykernel_14605/90004086.py in <module>
9 label=None,
10 visual=True,
---> 11 save_path=None)
/paddle/code/gry/InterpretDL/interpretdl/interpreter/gradient_cam.py in interpret(self, inputs, target_layer_name, label, resize_to, crop_to, visual, save_path)
99
100 # the core algorithm
--> 101 cam_weights = np.mean(g, (2, 3), keepdims=True)
102 heatmap = cam_weights * f
103 heatmap = heatmap.mean(1)
<__array_function__ internals> in mean(*args, **kwargs)
/usr/local/python3.7.0/lib/python3.7/site-packages/numpy/core/fromnumeric.py in mean(a, axis, dtype, out, keepdims, where)
3439
3440 return _methods._mean(a, axis=axis, dtype=dtype,
-> 3441 out=out, **kwargs)
3442
3443
/usr/local/python3.7.0/lib/python3.7/site-packages/numpy/core/_methods.py in _mean(a, axis, dtype, out, keepdims, where)
165 is_float16_result = False
166
--> 167 rcount = _count_reduce_items(arr, axis, keepdims=keepdims, where=where)
168 if rcount == 0 if where is True else umr_any(rcount == 0, axis=None):
169 warnings.warn("Mean of empty slice.", RuntimeWarning, stacklevel=2)
/usr/local/python3.7.0/lib/python3.7/site-packages/numpy/core/_methods.py in _count_reduce_items(arr, axis, keepdims, where)
74 items = nt.intp(1)
75 for ax in axis:
---> 76 items *= arr.shape[mu.normalize_axis_index(ax, arr.ndim)]
77 else:
78 # TODO: Optimize case when `where` is broadcast along a non-reduction
报错的命令为
请问我使用https://blog.csdn.net/PaddlePaddle/article/details/114609592这里面的教程
visualize_grayscale(gradients[0]) #将结果转化为灰度图,
对于这一句代码 我并没有找到库或是源文件什么的
加入我想要把特征激活的图转换灰度的 需要怎么做呢(例如:把激活的地方就是白色 未激活的就是黑色)
十分感谢你们的回复!
interpret的resize_to参数只能填一个数,我的网络长和宽不相等怎么送进gradcam分析
I attempted to apply the Grad-CAM algorithm to mobilenetv3-large but failed. Here are the error messages and version information I have. I think it may have some connection with the issue mentioned in this topic.
Steps to reproduce the behavior:
import interpretdl as it
from interpretdl.data_processor.readers import read_image
from paddle.vision.models import mobilenet_v3_large
from paddle.vision.models import resnet50
import os
import paddle
paddle.device.set_device('gpu:0')
# paddle_model = resnet50(pretrained=True)
paddle_model = mobilenet_v3_large(pretrained=True, num_classes=150)
checkpoint_path = ""
if os.path.exists(checkpoint_path):
param_state_dict = paddle.load(os.path.join(checkpoint_path, "mobileNetv3_5_16.pdparams"))
paddle_model.set_state_dict(param_state_dict)
gradcam = it.GradCAMInterpreter(paddle_model, device='gpu:0')
layers_name = []
for n, v in paddle_model.named_sublayers():
layers_name.append(n)
print(layers_name)
img_path = ''
print(paddle_model)
heatmap = gradcam.interpret(
img_path,
'lastconv.0',
label=None,
visual=True,
save_path=None)
Traceback (most recent call last):
File "interpretability.py", line 24, in <module>
heatmap = gradcam.interpret(
File "/home/xyt/.conda/envs/paddle/lib/python3.8/site-packages/interpretdl/interpreter/gradient_cam.py", line 90, in interpret
feature_map, gradients, preds = self.predict_fn(data, label)
File "/home/xyt/.conda/envs/paddle/lib/python3.8/site-packages/interpretdl/interpreter/gradient_cam.py", line 140, in predict_fn
out = self.model(data)
File "/home/xyt/.conda/envs/paddle/lib/python3.8/site-packages/paddle/fluid/dygraph/layers.py", line 1012, in __call__
return self.forward(*inputs, **kwargs)
File "/home/xyt/.conda/envs/paddle/lib/python3.8/site-packages/paddle/vision/models/mobilenetv3.py", line 237, in forward
x = self.conv(x)
File "/home/xyt/.conda/envs/paddle/lib/python3.8/site-packages/paddle/fluid/dygraph/layers.py", line 1012, in __call__
return self.forward(*inputs, **kwargs)
File "/home/xyt/.conda/envs/paddle/lib/python3.8/site-packages/paddle/fluid/dygraph/container.py", line 98, in forward
input = layer(input)
File "/home/xyt/.conda/envs/paddle/lib/python3.8/site-packages/paddle/fluid/dygraph/layers.py", line 1012, in __call__
return self.forward(*inputs, **kwargs)
File "/home/xyt/.conda/envs/paddle/lib/python3.8/site-packages/paddle/nn/layer/conv.py", line 712, in forward
out = F.conv._conv_nd(
File "/home/xyt/.conda/envs/paddle/lib/python3.8/site-packages/paddle/nn/functional/conv.py", line 140, in _conv_nd
pre_bias = _C_ops.conv2d(
OSError: (External) CUDNN error(4), CUDNN_STATUS_INTERNAL_ERROR.
[Hint: Please search for the error code(4) on website (https://docs.nvidia.com/deeplearning/cudnn/api/index.html#cudnnStatus_t) to get Nvidia's official solution and advice about CUDNN Error.] (at /paddle/paddle/phi/backends/gpu/gpu_resources.cc:227)
paddlepaddle-gpu 2.4.2.post116
NVIDIA A10 CUDA Version: 11.6
PaddlePaddle version (eg. 2.1): 2.4.2.post116
CPU: AMD EPYC 7713 64-Core Processor
GPU: 11.6/8.4.1
OS Platform (eg. Mac OS 10.14): ubuntu18.04
Graphics card storage: 23028MiB
Hi there. I am trying to implement CAM visualizations with a Mask R-CNN model. As you know, Mask R-CNN performs classifications per ROI, but the backbone network (for ex. a FPN with Resnet50 conv blocks) extracts features over the entire input image. Could you provide some guidance as to how to use InterpretDL to generate CAM with a Mask R-CNN model? Much appreciated!
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?
我的代码如下:
import interpretdl as it
from interpretdl.data_processor.visualizer import visualize_grayscale
ResNet18_PATH = "ResNet18_chk_points/final.pdparams"
ResNet18 = paddle.vision.models.resnet18(pretrained=True, num_classes=6)
ResNet18_state_dict = paddle.load(ResNet18_PATH)
ResNet18.set_dict(ResNet18_state_dict)
ResNet18_gradcam = it.GradCAMInterpreter(ResNet18, use_cuda=True)
ResNet18_gradients = ResNet18_gradcam.interpret("face/Trump/1.jpg", target_layer_name='concat_0.tmp_0', visual=True, save_path=None) #展示结果
visualize_grayscale(ResNet18_gradients[0]) #将结果转化为灰度图,展示效果更直观
输出结果:
---------------------------------------------------------------------------NameError Traceback (most recent call last)<ipython-input-32-384a620fc707> in <module>
1 ResNet18_gradcam = it.GradCAMInterpreter(ResNet18, use_cuda=True)
2
----> 3 ResNet18_gradients = ResNet18_gradcam.interpret("face/Trump/1.jpg", target_layer_name='concat_0.tmp_0', visual=True, save_path=None) #展示结果
4
5 visualize_grayscale(ResNet18_gradients[0]) #将结果转化为灰度图,展示效果更直观
/opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages/interpretdl/interpreter/gradient_cam.py in interpret(self, inputs, target_layer_name, labels, visual, save_path)
91 bsz = len(data)
92 if labels is None:
---> 93 _, _, preds = self.predict_fn(data, labels)
94 labels = preds
95 labels = np.array(labels).reshape((bsz, ))
/opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages/interpretdl/interpreter/gradient_cam.py in predict_fn(data, labels)
151 target = paddle.sum(out * labels_onehot, axis=1)
152 gradients = paddle.grad(
--> 153 outputs=[target], inputs=[feature_maps])[0]
154 return feature_maps.numpy(), gradients.numpy(), labels
155
NameError: name 'feature_maps' is not defined
Our paper "LayerCAM: Exploring Hierarchical Class Activation Maps for Localization" is accepted by TIP recently, which can visualize the class activation maps from any cnn layer of an off-the-shelf network. Could you add our method to your popular repository for more people to try this method? Our method is a simple modification of Grad-CAM. It should easy to implement. Here is the paper and code. Hope for your reply.
比如在推荐系统中,我们一般使用的数据很少是图片和text类型的,一般都是数值型连续或者离散特征的数据,对于这种普遍的应用场景,有没有打算支持呢?
怎么拿出paddledetection中间的某一层进行可视化呢?
(optional) Briefly introduce yourself.
eval之后是有梯度的,具体可见PPMA
感谢你们项目,获取梯度参考了你们几行代码
paddle完善hook,可能会更舒服一点
纯属交流~如果我理解有错欢迎讨论哈
Unable to init server: Could not connect: Connection refused
Unable to init server: Could not connect: Connection refused
/usr/local/lib/python3.8/dist-packages/matplotlib/backends/backend_gtk3.py:40: DeprecationWarning: Gdk.Cursor.new is deprecated
cursors.MOVE: Gdk.Cursor.new(Gdk.CursorType.FLEUR),
(gmlp_view.py:513934): Gdk-CRITICAL **: 01:20:32.911: gdk_cursor_new_for_display: assertion 'GDK_IS_DISPLAY (display)' failed
Killed
(optional) Briefly introduce yourself.
似乎InterpretDL没有提供shapely value的相关计算工具和可视化功能?我没有很了解,是否有大佬能提供帮助和讯息,paddle有没有提供类似的计算方法呀?
主要shap库:https://github.com/slundberg/shap
依赖pytroch,pytroch又跟paddle不兼并。搞的我用paddle训练的模型,无法用shapely value 去做解释说明诶...
当我pip install interpretdl的时候
报错
Failed to build scikit-learn
ERROR: Could not build wheels for scikit-learn, which is required to install pyproject.toml-based projects
请问是为什么
现在的模型都是基于“”训练模型“上做的。
如果要考虑到部署的情况,能否在“推断模型”上,去得到输出层到最后一层conv层的gradient?
使用pip直接安装报错:
ERROR: Could not find a version that satisfies the requirement interpretDL (from versions: none) ERROR: No matching distribution found for interpretDL
如题,期待回复。
谢谢
Could you make a new release so that pip install includes newer features like the Infidelity metric? Other metrics are found without problems
Input data processing needs to be flexible and can be customized.
Currently, images are normalized according to natural images, like ImageNet statistics. However, for medical, remote sensing, and other types of 2D inputs (or even more complex data), current pipelines cannot deal with.
Maybe paddle.vision.transforms
or other transformations can be used.
import paddle
from PIL import Image
import interpretdl as it
from interpretdl.data_processor.readers import read_image
from paddleseg.models import MixVisionTransformer_B5
from paddleseg.models.backbones import *
url = 'https://bj.bcebos.com/paddleseg/dygraph/pretrained_models/vit_small_patch16_384_augreg.tar.gz'
paddle_model = ViT_base_patch16_384(pretrained=url, num_classes=2)
result = [n for n, v in paddle_model.named_sublayers()]
print(result)
tam = it.TAMInterpreter(paddle_model)
Path = "imgs/catdog.jpg"
Layer = 'norm1'
heatmap = tam.interpret(
Path,
start_layer=4,
label=None, # cat
visual=True,
save_path=None)
代码如上,不管我换什么网络换什么层显示都报这个错
泪目了,求助
Traceback (most recent call last):
File "D:\project\InterpretDL-master\test.py", line 20, in
heatmap = tam.interpret(
File "D:\project\InterpretDL-master\interpretdl\interpreter\transition_attention_maps.py", line 78, in interpret
attns, _, preds = self.predict_fn(data)
File "D:\project\InterpretDL-master\interpretdl\interpreter\transition_attention_maps.py", line 149, in predict_fn
out = paddle.nn.functional.softmax(out, axis=1)
File "C:\soft\anaconda3\envs\paddle\lib\site-packages\paddle\nn\functional\activation.py", line 1142, in softmax
return _C_ops.softmax(outs_cast, axis)
ValueError: (InvalidArgument) softmax(): argument 'x' (position 0) must be Tensor, but got list (at ..\paddle\fluid\pybind\eager_utils.cc:894)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.