找回密码
 立即注册
搜索
查看: 2809|回复: 18

[软件] 一段python代码在linux上跑总被系统killed会是啥原因?

[复制链接]
     
发表于 2021-1-4 15:08 | 显示全部楼层 |阅读模式
本帖最后由 子虚乌有 于 2021-1-4 18:25 编辑

是我自己写的一小段用tensoreflow计算东西的小程序。
跑在阿里云上,1c2g的配置,用tf 1.13的cpu
程序本身逻辑没问题跑了很久了。
最近旧的服务器到期了,买了个新的挪到新的。
系统都是ubuntu18.04。
发现新的上面,用conda装的tf库,predict几次就会被系统killed,明明当时free还有600多m内存。用pip装的tf库倒是挺稳定,然而慢的不得了。比旧的服务器慢3倍。
都是一个机架的1c2g的按理说没那么大差距。

anaconda是同一套安装程序。tf版本一致。


回复

使用道具 举报

     
 楼主| 发表于 2021-1-4 17:45 | 显示全部楼层
看了下日志还是内存原因。
奇怪为啥之前的系统不会出现。一样的
Jan  4 17:42:03  kernel: Out of memory: Killed process 26374 (python) total-vm:2824452kB, anon-rss:1649924kB, file-rss:0kB, shmem-rss:0kB, UID:0
Jan  4 17:42:03  kernel: oom_reaper: reaped process 26374 (python), now anon-rss:0kB, file-rss:0kB, shmem-rss:0kB
回复

使用道具 举报

     
发表于 2021-1-4 17:57 来自手机 | 显示全部楼层
@Python3

—— 来自 samsung SM-G9750, Android 10上的 S1Next-鹅版 v2.4.3

评分

参与人数 1战斗力 +1 收起 理由
Sza + 1 缺德

查看全部评分

回复

使用道具 举报

     
发表于 2021-1-4 18:04 | 显示全部楼层
子虚乌有 发表于 2021-1-4 17:45
看了下日志还是内存原因。
奇怪为啥之前的系统不会出现。一样的
Jan  4 17:42:03  kernel: Out of memory:  ...

是不是现在的没swap之前的有?
回复

使用道具 举报

     
发表于 2021-1-4 18:05 | 显示全部楼层
都ubuntu了干嘛要anaconda??一个一个pip3也没要你多久吧?
回复

使用道具 举报

     
 楼主| 发表于 2021-1-4 18:08 | 显示全部楼层
Damenly 发表于 2021-1-4 18:04
是不是现在的没swap之前的有?

我检查检查。
话说都是阿里给的标准模板,没道理不一样
回复

使用道具 举报

     
 楼主| 发表于 2021-1-4 18:08 | 显示全部楼层
xxad 发表于 2021-1-4 18:05
都ubuntu了干嘛要anaconda??一个一个pip3也没要你多久吧?

你说的确实也是
回复

使用道具 举报

     
发表于 2021-1-4 18:11 | 显示全部楼层
tf 1.3 是什么上古版本……

pip的版本可能是没有SSE等指令集支持的。我记得用1.10左右时,tf官方有编译指导,1.3有点太古老了

新服务器有没有设置swap?
回复

使用道具 举报

     
 楼主| 发表于 2021-1-4 18:25 | 显示全部楼层
Mayrixon 发表于 2021-1-4 18:11
tf 1.3 是什么上古版本……

pip的版本可能是没有SSE等指令集支持的。我记得用1.10左右时,tf官方有编译指 ...

我写错了
是tf1.13.1
回复

使用道具 举报

     
发表于 2021-1-4 18:28 来自手机 | 显示全部楼层
看下OOMKILLER是干嘛的就知道了
回复

使用道具 举报

     
发表于 2021-1-4 19:05 来自手机 | 显示全部楼层
可能是conda装的tf带有mkl吧


楼主放狗搜pip tensorfow mkl wheel之类的找找看


—— 来自 Xiaomi Mi 10, Android 10上的 S1Next-鹅版 v2.4.3
回复

使用道具 举报

     
 楼主| 发表于 2021-1-4 20:34 | 显示全部楼层
嗯,killed的原因果然是swap,旧的os里面配了swap,新的swap是0
慢的原因还在找。
不是mkl,新的跑sysbench比旧的慢了一些。新的是3200多event,旧的是3700多event。
再找找原因吧。
回复

使用道具 举报

     
 楼主| 发表于 2021-1-4 20:37 | 显示全部楼层
cpuinfo
siblings        : 1
core id         : 0
cpu cores       : 1
apicid          : 0
initial apicid  : 0
fpu             : yes
fpu_exception   : yes
cpuid level     : 13
wp              : yes
flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ss ht syscall nx pdpe1gb rdtscp lm constant_tsc rep_good nopl cpuid pni pclmulqdq ssse3 fma cx16 pcid sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand hypervisor lahf_lm abm 3dnowprefetch invpcid_single pti ibrs ibpb stibp fsgsbase tsc_adjust bmi1 hle avx2 smep bmi2 erms invpcid rtm mpx avx512f avx512dq rdseed adx smap avx512cd avx512bw avx512vl xsaveopt xsavec xgetbv1
bugs            : cpu_meltdown spectre_v1 spectre_v2 spec_store_bypass l1tf
bogomips        : 5000.00
clflush size    : 64
cache_alignment : 64
address sizes   : 46 bits physical, 48 bits virtual
power management:



core id         : 0
cpu cores       : 1
apicid          : 0
initial apicid  : 0
fpu             : yes
fpu_exception   : yes
cpuid level     : 13
wp              : yes
flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ss ht syscall nx pdpe1gb rdtscp lm constant_tsc rep_good nopl nonstop_tsc cpuid tsc_known_freq pni pclmulqdq ssse3 fma cx16 pcid sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand hypervisor lahf_lm abm 3dnowprefetch invpcid_single pti ibrs ibpb stibp fsgsbase tsc_adjust bmi1 hle avx2 smep bmi2 erms invpcid rtm rdseed adx smap xsaveopt arat
bugs            : cpu_meltdown spectre_v1 spectre_v2 spec_store_bypass l1tf mds swapgs taa itlb_multihit
bogomips        : 4999.99
clflush size    : 64
cache_alignment : 64
address sizes   : 46 bits physical, 48 bits virtual
power management:

回复

使用道具 举报

     
 楼主| 发表于 2021-1-4 20:39 | 显示全部楼层
cpu是不一样的居然

1  Intel(R) Xeon(R) Platinum 8163 CPU @ 2.50GHz
1  Intel(R) Xeon(R) CPU E5-2682 v4 @ 2.50GHz
回复

使用道具 举报

     
发表于 2021-1-4 20:41 来自手机 | 显示全部楼层
找客服呗

—— 来自 Sony H8296, Android 10上的 S1Next-鹅版 v2.4.3
回复

使用道具 举报

     
 楼主| 发表于 2021-1-4 21:03 | 显示全部楼层
本帖最后由 子虚乌有 于 2021-1-4 21:06 编辑

为啥装不上intel的tf呢
https://pypi.org/project/intel-tensorflow/1.13.1/

pip3 install intel-tensorflow==1.13.1 -i https://pypi.python.org/simple
Looking in indexes: https://pypi.python.org/simple
ERROR: Could not find a version that satisfies the requirement intel-tensorflow==1.13.1 (from versions: 0.0.1, 2.1.1, 2.2.0, 2.3.0)
ERROR: No matching distribution found for intel-tensorflow==1.13.1

原来没有3.6的。
坑略多。

回复

使用道具 举报

     
 楼主| 发表于 2021-1-6 19:50 | 显示全部楼层
找客服投诉虚假宣传了,然后退钱了事。
回复

使用道具 举报

     
发表于 2021-1-7 01:12 来自手机 | 显示全部楼层
编辑,看错了
回复

使用道具 举报

发表于 2021-1-7 06:25 | 显示全部楼层
超内存了呗

自己打log去,上论坛问得出个啥
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

Archiver|手机版|小黑屋|上海互联网违法和不良信息举报中心|网上有害信息举报专区|962110 反电信诈骗|举报电话 021-62035905|Stage1st ( 沪ICP备13020230号-1|沪公网安备 31010702007642号 )

GMT+8, 2024-9-24 19:15 , Processed in 0.236505 second(s), 6 queries , Gzip On, Redis On.

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表