Bonjour, je souhaite faire la classification de tumeurs d’une image de pathologie numérique, j’utilise un modèle CNN déja près que j’ai récupéré du site:(https://www.frontiersin.org/articles/10.3389/fmolb.2020.00183/full)
j’obtiens l’erreur suivante: ‘ReLU’ object has no attribute ‘threshold’
il semble qu’il y ait une incohérence dans le modèle pré-entrainé, car un des activations
essaye de passer une valeur seuil à une activation de type “relu”, alors que cette fonction d’activation n’a pas de paramètre de seuil.
merci d’avance pour votre réponse
From Google translate:
Hello, I want to do the classification of tumors from a digital pathology image, I am using a CNN model already close that I got from the site: (https://www.frontiersin.org/articles/10.3389/fmolb. 2020.00183 / full)
I get the following error: ‘ReLU’ object has no attribute ‘threshold’
there seems to be an inconsistency in the pre-trained model, because one of the activations
tries to pass a threshold value to a “reread” type activation, when this activation function does not have a threshold parameter.
Thank you in advance for your reply
@Achrouf could you use an online translator for further posts, please?
For the issue:
The nn.ReLU
module doesn’t have a threshold
method, so you might want to use e.g. torch.threshold
.
please can tell me what to do exactly, i’m new to cnn network with python, thanks
Could you post a minimal and executable code snippet, which would reproduce this issue, so that we could help debugging?
Based on the error it seems you are trying to use:
relu = nn.ReLU()
relu.threshold()
> AttributeError: 'ReLU' object has no attribute 'threshold'
while most likely you want to use:
relu = nn.ReLU()
x = torch.randn(10, 10)
out = relu(x)
Thank you for your answer, there was no problem in the resnet model that I used, I just installed a version 1.1.0 pyrtorch and it worked!