# Error plot Convolution result CNN

how I display the result of the convolution as an image?

``````out1 = self.cnn6(out1)
out1 = self.batchnorm6(out1)
out1 = self.relu(out1)
plt.imshow(np.transpose(out1, (1,2,0)), interpolation='nearest')
``````

RuntimeError: Can’t call numpy() on Tensor that requires grad. Use tensor.detach().numpy() instead.

Did you try to use the suggestion from the error message?
Once you fix the `numpy()` error, you would have to check the shape of the output, since `imshow` expects an image format, while your output activation would contain the additional batch dimension. In that case, you could visualize each output separately. Also, you have to make sure the channel dimension is valid for an image format (i.e. it has to be 1 or 3). If that’s not the case, you could visualize each channel separately again.
{"ft_lang_label":"__label__en","ft_lang_prob":0.9422232,"math_prob":0.92702085,"size":491,"snap":"2022-05-2022-21","text_gpt3_token_len":105,"char_repetition_ratio":0.11293635,"word_repetition_ratio":0.024096385,"special_character_ratio":0.21588595,"punctuation_ratio":0.12745099,"nsfw_num_words":0,"has_unicode_error":false,"math_prob_llama3":0.9839382,"pos_list":[0],"im_url_duplicate_count":[null],"WARC_HEADER":"{\"WARC-Type\":\"response\",\"WARC-Date\":\"2022-05-19T15:48:54Z\",\"WARC-Record-ID\":\"<urn:uuid:7c985c7c-61b5-40e0-861f-0b10694ca547>\",\"Content-Length\":\"14568\",\"Content-Type\":\"application/http; msgtype=response\",\"WARC-Warcinfo-ID\":\"<urn:uuid:5c109eea-5298-4c0a-8277-29331832fc43>\",\"WARC-Concurrent-To\":\"<urn:uuid:f0182f5e-b848-4f3b-9709-4cb96b07589d>\",\"WARC-IP-Address\":\"159.203.145.104\",\"WARC-Target-URI\":\"https://discuss.pytorch.org/t/error-plot-convolution-result-cnn/138543\",\"WARC-Payload-Digest\":\"sha1:CNFNCXLJSGWUQ3GGE7LHF52KAMUUDWGU\",\"WARC-Block-Digest\":\"sha1:NBJKSHJNO37DCR2YAQLVW57R63P3PKHG\",\"WARC-Identified-Payload-Type\":\"text/html\",\"warc_filename\":\"/cc_download/warc_2022/CC-MAIN-2022-21/CC-MAIN-2022-21_segments_1652662529538.2_warc_CC-MAIN-20220519141152-20220519171152-00157.warc.gz\"}"}