Category : kernel

This code causes python to crash. Then when I run it again, I get this error: "Error: Session cannot generate requests." I try restarting the kernel but it just never recovers. I have to close VS Code and reopen it to run code again. What is causing this? import turtle import random as r for ..

Read more

I installed Anaconda, and created a second environment (i.e. vamp_env) to run my script in Python 3.6. I build my script a couple of years ago using Python 3.6, and older versions of the packages listed below. I used my script on numerous occasions, it runs well however only with the package versions listed below. ..

Read more

I have a trained model called model. I try to generate an optimized version of it using the following code: from tensorflow.python.compiler.tensorrt import trt_convert as trt params = trt.DEFAULT_TRT_CONVERSION_PARAMS._replace(precision_mode=’FP16′, is_dynamic_op=True) converter = trt.TrtGraphConverterV2(input_saved_model_dir=’model’,conversion_params=params) #converter.convert() When the code reach the line trt.TrtGraphConverterV2 the kernel get killed and I get the message of restarting the kernel automatically. ..

Read more

I have this code in python which is creating an SVM using different kernels: from sklearn.svm import SVC from sklearn.model_selection import train_test_split from sklearn.metrics import accuracy_score, roc_auc_score X_train, X_test, y_train, y_test = train_test_split(X, y, test_size = 0.3) # The gamma parameter is the kernel coefficient for kernels rbf/poly/sigmoid svm = SVC(gamma=’auto’, probability=True) svm.fit(X_train,y_train.values.ravel()) prediction = ..

Read more

I am trying to prompt the user for selecting an option from a finite list of options. I tried using inquirer.List(). The inquirer module seems to work fine on my windows shell but it does not work with Jupyter Notebook. On running the cell with questions = [inquirer.List(‘regression_model’, message = ‘Select the best Regression Model ..

Read more