简体   繁体   English

在 virtualbox ubuntu 20.04 python 2.7 - '非法指令(核心转储)'上安装 tensorflow

[英]Installing tensorflow on virtualbox ubuntu 20.04 python 2.7 - 'Illegal instruction (core dumped)'

my goal is to follow this guide so that I can convert a Caffe model to a Tensorflow model.我的目标是遵循本指南,以便将 Caffe model 转换为 Tensorflow model。 As my original OS is Windows 10 I am using the virtual Ubuntu 20.04 (using Oracle VirtualBox) with python 2.7 and anaconda virtual env. As my original OS is Windows 10 I am using the virtual Ubuntu 20.04 (using Oracle VirtualBox) with python 2.7 and anaconda virtual env. I am able to successfully install tensorflow for python 2.7, but when I run the command python -c 'import tensorflow' , I get an error with text Illegal instruction (core dumped) .我能够成功地为 python 2.7 安装 tensorflow,但是当我运行命令python -c 'import tensorflow'时,我收到错误的文本Illegal instruction (core dumped) I have tried to google to get more information but all I got was that it maybe has something to do with the architecture, I found out that my architecture (on the virtual ubuntu) is x86_64 .我试图用谷歌搜索更多信息,但我得到的只是它可能与架构有关,我发现我的架构(在虚拟 ubuntu 上)是x86_64 That is all I have found out and now I turned to SO to ask what I should do to be able to run tensorflow in the before described environment, many thanks beforehand.这就是我所发现的,现在我转向 SO 询问我应该怎么做才能在上述环境中运行 tensorflow,非常感谢。

For those wondering, the pip or conda installation did not work in my case, so I followed the instructions on this guide for linux, python 2.7 using the pip installation method with a tensorflow version of 0.10, which for my purposes is good enough. For those wondering, the pip or conda installation did not work in my case, so I followed the instructions on this guide for linux, python 2.7 using the pip installation method with a tensorflow version of 0.10, which for my purposes is good enough.

Exact steps in case the link does not work in the future:万一该链接将来不起作用的确切步骤:

  • $ conda create -n tensorflow python=2.7
  • $ conda activate tensorflow
  • Your prompt should change to this: (tensorflow)$您的提示应更改为: (tensorflow)$
  • (tensorflow)$ export TF_BINARY_URL=https://storage.googleapis.com/tensorflow/linux/cpu/tensorflow-0.10.0-cp27-none-linux_x86_64.whl
  • (tensorflow)$ pip install --ignore-installed --upgrade $TF_BINARY_URL

This is, as outlined, for python 2.7, but the guide contains info for newer versions as well.如前所述,这适用于 python 2.7,但该指南也包含更新版本的信息。 To check whether tensorflow installed correctly you can run this command $ python -c 'import tensorflow as tf; print(tf.__version__)'要检查 tensorflow 是否安装正确,您可以运行此命令$ python -c 'import tensorflow as tf; print(tf.__version__)' $ python -c 'import tensorflow as tf; print(tf.__version__)' which should output 0.10.0 . $ python -c 'import tensorflow as tf; print(tf.__version__)'应该是 output 0.10.0

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM