首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >如何在ubuntu20上以后端为后台在termux上运行keras

如何在ubuntu20上以后端为后台在termux上运行keras
EN

Stack Overflow用户
提问于 2021-06-27 10:13:15
回答 1查看 197关注 0票数 0

我尝试在Pydroid 3 (Android)上安装theano和keras,这是我成功的,但是在运行keras时,theano不是keras的后端,所以我在termux上安装了ubuntu 20,并使用以下命令安装了keras和theano:

apt install python3-keras --no-install-recommends && apt install python3-theano --no-install-recommends

它已经成功安装,当我想要后端的东西作为theano时,我搜索~/.keras/keras.json,但是它不在那里,所以我想检查它,所以我运行它,给了我以下错误:

代码语言:javascript
复制
root@localhost~# python3 testkeras.py
[localhost:21091] opal_ifinit: ioctl(SIOCGIFHWADDR) failed with errno=13
[localhost:21092] opal_ifinit: ioctl(SIOCGIFHWADDR) failed with errno=13
[localhost:21092] pmix_ifinit: ioctl(SIOCGIFHWADDR) failed with errno=13
[localhost:21092] oob_tcp: problems getting address for index 88256 (kernel index -1)
--------------------------------------------------------------------------     No network interfaces were found for out-of-band communications. We require
at least one available network for out-of-band messaging.
--------------------------------------------------------------------------
[localhost:21091] [[INVALID],INVALID] ORTE_ERROR_LOG: Unable to start a daemon on the local node in file ess_singleton_module.c at line 716
[localhost:21091] [[INVALID],INVALID] ORTE_ERROR_LOG: Unable to start a daemon on the local node in file ess_singleton_module.c at line 172                   --------------------------------------------------------------------------     It looks like orte_init failed for some reason; your parallel process is
likely to abort.  There are many reasons that a parallel process can
fail during orte_init; some of which are due to configuration or
environment problems.  This failure appears to be an internal failure;
here's some additional information (which may only be relevant to an
Open MPI developer):

  orte_ess_init failed
  --> Returned value Unable to start a daemon on the local node (-127) instead of ORTE_SUCCESS
--------------------------------------------------------------------------
--------------------------------------------------------------------------
It looks like MPI_INIT failed for some reason; your parallel process is
likely to abort.  There are many reasons that a parallel process can
fail during MPI_INIT; some of which are due to configuration or environment
problems.  This failure appears to be an internal failure; here's some
additional information (which may only be relevant to an Open MPI
developer):

  ompi_mpi_init: ompi_rte_init failed
  --> Returned "Unable to start a daemon on the local node" (-127) instead of "Success" (0)
--------------------------------------------------------------------------
*** An error occurred in MPI_Init_thread
*** on a NULL communicator
*** MPI_ERRORS_ARE_FATAL (processes in this communicator will now abort,
***    and potentially your MPI job)
[localhost:21091] Local abort before MPI_INIT completed completed successfully, but am not able to aggregate error messages, and not able to guarantee that all other processes were killed!

( 1.)我想知道问题出在哪里。

( 2.)欢迎提出建议。

我运行的代码,如果你们中有人想知道

代码语言:javascript
复制
import numpy as np

from keras.models import Sequential
from keras.layers import Dense, Dropout

--这是我安装的模块:

代码语言:javascript
复制
Package             Version
------------------- -------
decorator           4.4.2                                                      h5py                2.10.0
Keras               2.2.4
Keras-Applications  1.0.6
Keras-Preprocessing 1.0.5
mpi4py              3.0.3
numpy               1.17.4
pip                 20.0.2                                                     PyYAML              5.3.1                                                      scipy               1.3.3
setuptools          45.2.0
six                 1.14.0
Theano              1.0.4
wheel               0.34.2

和我是这个机器学习领域的新成员

有关系统的其他一些信息

代码语言:javascript
复制
            .-/+oossssoo+/-.
        `:+ssssssssssssssssss+:`
      -+ssssssssssssssssssyyssss+-
    .ossssssssssssssssssdMMMNysssso.
   /ssssssssssshdmmNNmmyNMMMMhssssss/      root@localhost
  +ssssssssshmydMMMMMMMNddddyssssssss+     --------------
 /sssssssshNMMMyhhyyyyhmNMMMNhssssssss/    OS: Ubuntu 20.04 LTS focal aarch64
.ssssssssdMMMNhsssssssssshNMMMdssssssss.   Kernel: 4.4.147+
+sssshhhyNMMNyssssssssssssyNMMMysssssss+   Uptime: 18805 days, 10 hours, 9 min
ossyNMMMNyMMhsssssssssssssshmmmhssssssso   Packages: 202 (dpkg)
ossyNMMMNyMMhsssssssssssssshmmmhssssssso   Shell: bash 5.0.16
+sssshhhyNMMNyssssssssssssyNMMMysssssss+   Terminal: proot
.ssssssssdMMMNhsssssssssshNMMMdssssssss.   CPU: Unisoc SC9863a (8) @ 1.200GHz
 /sssssssshNMMMyhhyyyyhdNMMMNhssssssss/    Memory: 957MiB / 1819MiB
  +sssssssssdmydMMMMMMMMddddyssssssss+
   /ssssssssssshdmNNNNmyNMMMMhssssss/
    .ossssssssssssssssssdMMMNysssso.
      -+sssssssssssssssssyyyssss+-
        `:+ssssssssssssssssss+:`
            .-/+oossssoo+/-.
EN

回答 1

Stack Overflow用户

发布于 2021-06-28 08:28:14

谢谢史努比医生我终于让它正常工作了。但是,我不得不删除os,并在不需要任何情况下重新安装它,方法是使用were apt install proot-distro命令,但我认为真正的问题是命令apt install python3-keras --no-install-recommends,正如您所说的,存在一些不满意的依赖关系或平台不一致。

好了,最后要做的步骤是让它正常工作,

1.在termux apt install proot-distro && proot-distro install ubuntu-18.04 && apt install python3-keras中输入以下命令

2.,然后使用最喜欢的文本编辑器编辑我使用的vim文件--在本例中是vim .keras/keras.json --该文件将类似于以下内容:

代码语言:javascript
复制
{
    "floatx": "float32",
    "epsilon": 1e-07,
    "backend": "tensorflow",
    "image_data_format": "channels_last"
}

并将后端的值更改为theano,在我的例子中,我是ad theano ,文件应该如下所示:

代码语言:javascript
复制
{
    "floatx": "float32",
    "epsilon": 1e-07,
    "backend": "theano",
    "image_data_format": "channels_last"
}

然后通过进入python交互模式来保存file.And测试,并输入import keras,输出应该是Using Theano as Backend ,我认为这应该可以帮助其他人.

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/68150069

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档