运行face_recognition模型导致“ python停止工作”

我尝试运行以下代码:

     import face_recognition
     known_image = face_recognition.load_image_file("biden.jpg")
     unknown_image = face_recognition.load_image_file("unknown.jpg")

     biden_encoding = face_recognition.face_encodings(known_image)[0]
     unknown_encoding = face_recognition.face_encodings(unknown_image)[0]

     results = face_recognition.compare_faces([biden_encoding],unknown_encoding)

known_imageunknown_image的类型为numpy.ndarray,并在其中装入值。但是,在调用函数face_recognition.face_encodings时,会出现以下消息:

 Python has stopped working. Kernel has been dead and restarted.

不知道发生了什么事

ynn0705 回答:运行face_recognition模型导致“ python停止工作”

你是什么jupyter,python版本?

原因1:安装失败

您可以尝试卸载所有内容吗?

#! /bin/bash

# install gcp logging agent
curl -sSO https://dl.google.com/cloudagents/install-logging-agent.sh
sudo bash install-logging-agent.sh

# setup a configuration for startup-script logs only
cat > /etc/google-fluentd/config.d/startup-script-log.conf <<- EOM
<source>
    @type tail
    # Format 'none' indicates the log is unstructured (text).
    format none
    # The path of the log file.
    path /tmp/startup-script-log.log
    # The path of the position file that records where in the log file
    # we have processed already. This is useful when the agent
    # restarts.
    pos_file /var/lib/google-fluentd/pos/startup-script-log.pos
    read_from_head true
    # The log tag for this log input.
    tag startup-script-log
</source>
EOM

# restart logging agent
sudo service google-fluentd restart

# redirect outputs to dedicated startup-script log
exec &>> /tmp/startup-script-log.log

# your startup-script content
# ...

echo "hello the world"

更多信息here.

原因2 :数据量巨大,内存不足,内核死亡

本文链接:https://www.f2er.com/3067206.html

大家都在问