English 中文(简体)
j子在jupyter notebook上运行时坠毁
原标题:Kernel crashes when running cnn in jupyter notebook

I am a window10 user I m running tensorflow in jupyter notebook, perceptron works fine, but cnn kernel crashes. I also tried increasing the buffer size, but the kernel keeps crashing. I made a model with cnn in Kolab, and when I download the model and run it with a Jupyter notebook, the kernel dies. Also, making a model with a jupyter notebook kills the kernel. In jupyter notebook, training with perceptron is possible, but with cnn it always kills the kernel. But .summary() works. What s wrong?

import numpy as np
import tensorflow as tf


testcnn=tf.keras.models.load_model("my_lasthomework_cnn.h5")
testcnn.summary()
import pandas as pd

from PIL import Image
test_dir= dir 
test_csv = pd.read_csv(test_dir+ test.csv )
test_images=[]
for file in test_csv[ data ]:
    image=np.array(Image.open(test_dir+ test/ +file))
    test_images.append(image)
test_images=np.array(test_images)


for i in test_images:
    p1=testcnn.predict(i.reshape(1,64,64,3))
    print(np.argmax(p1))

问题回答

我正在通过机器/深造课程,并遇到同样的问题——我手提的手提电脑与万国邮联一道在管理示范培训说明书时将坠毁。

借助Windows 11 Preview 的剪辑,在WSL上站出来,花了一些时间寻找问题的根源/解决办法。

然而,上文关于腐败的笔记和将代码移至新笔记(以及单独/新的虚拟环境)的建议,使问题消失。

不过,我必须说的是,我知道失败的根源,而新的笔记本/文告解决了这一问题。





相关问题
Can Django models use MySQL functions?

Is there a way to force Django models to pass a field to a MySQL function every time the model data is read or loaded? To clarify what I mean in SQL, I want the Django model to produce something like ...

An enterprise scheduler for python (like quartz)

I am looking for an enterprise tasks scheduler for python, like quartz is for Java. Requirements: Persistent: if the process restarts or the machine restarts, then all the jobs must stay there and ...

How to remove unique, then duplicate dictionaries in a list?

Given the following list that contains some duplicate and some unique dictionaries, what is the best method to remove unique dictionaries first, then reduce the duplicate dictionaries to single ...

What is suggested seed value to use with random.seed()?

Simple enough question: I m using python random module to generate random integers. I want to know what is the suggested value to use with the random.seed() function? Currently I am letting this ...

How can I make the PyDev editor selectively ignore errors?

I m using PyDev under Eclipse to write some Jython code. I ve got numerous instances where I need to do something like this: import com.work.project.component.client.Interface.ISubInterface as ...

How do I profile `paster serve` s startup time?

Python s paster serve app.ini is taking longer than I would like to be ready for the first request. I know how to profile requests with middleware, but how do I profile the initialization time? I ...

Pragmatically adding give-aways/freebies to an online store

Our business currently has an online store and recently we ve been offering free specials to our customers. Right now, we simply display the special and give the buyer a notice stating we will add the ...

Converting Dictionary to List? [duplicate]

I m trying to convert a Python dictionary into a Python list, in order to perform some calculations. #My dictionary dict = {} dict[ Capital ]="London" dict[ Food ]="Fish&Chips" dict[ 2012 ]="...

热门标签