0
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals

import check_util.checker as checker
from IPython.display import clear_output
from PIL import Image

import os
import time
import re
from glob import glob
import shutil
import numpy as np
import matplotlib.pyplot as plt
%matplotlib inline

import tensorflow as tf
from tensorflow import keras
from tensorflow.keras import layers
from tensorflow import keras

print('tensorflow version: {}'.format(tf.__version__))
print('GPU available: {}'.format(tf.test.is_gpu_available()))

Error: Session cannot generate requests Error: Session cannot generate requests at w.executeCodeCell (c:\Users\ooche.vscode\extensions\ms-toolsai.jupyter-2021.8.1054968649\out\client\extension.js:90:320068) at w.execute (c:\Users\ooche.vscode\extensions\ms-toolsai.jupyter-2021.8.1054968649\out\client\extension.js:90:319389) at w.start (c:\Users\ooche.vscode\extensions\ms-toolsai.jupyter-2021.8.1054968649\out\client\extension.js:90:315205) at runMicrotasks () at processTicksAndRejections (internal/process/task_queues.js:93:5) at async t.CellExecutionQueue.executeQueuedCells (c:\Users\ooche.vscode\extensions\ms-toolsai.jupyter-2021.8.1054968649\out\client\extension.js:90:329732) at async t.CellExecutionQueue.start (c:\Users\ooche.vscode\extensions\ms-toolsai.jupyter-2021.8.1054968649\out\client\extension.js:90:329272)

I think this problem has something to do with kernel.

But I can't find a solution, even though I've already reinstalled and restarted.

Please help me solve this problem.

I'm using Python 3.7.10, Tensorflow 2.3

Ironman
  • 68
  • 9
  • Check out this one: https://stackoverflow.com/questions/68259660/vscode-fails-to-run-python-with-this-error-error-session-cannot-generate-reque May be it helps – Onur Baştürk Aug 01 '21 at 19:08
  • @OnurBaştürk I tried but it's not working for me.. thanks answer. – Ironman Aug 02 '21 at 02:42

1 Answers1

0

Please try again by restarting the VS code or by changing the jupyter virtual environment (Change kernel for the notebook) while executing this code in VS code.

(I tried the same code as mentioned above in VS code using python 3.7.10 and tensorflow=2.3 and it executed successfully)

Please check this output:

tensorflow version: 2.3.0
WARNING:tensorflow:From C:\Users\Hp\AppData\Local\Temp\ipykernel_6944\127915523.py:16: is_gpu_available (from tensorflow.python.framework.test_util) is deprecated and will be removed in a future version.
Instructions for updating:
Use `tf.config.list_physical_devices('GPU')` instead.
GPU available: False