【发布时间】:2018-08-08 23:38:33
【问题描述】:
我有大约 1.7 GB 的手电筒模型,我尝试将此模型写入文件或打印。代码如下:
import numpy
numpy.set_printoptions(threshold=numpy.nan)
import torchfile
o = torchfile.load('ptn_comb.t7')
#print o
numpy.savetxt("test.txt",o)
当我删除“numpy.set_printoptions(threshold=numpy.nan)”打印和 savetxt 运行正常并在 10-15 分钟内终止。但是,使用“numpy.set_printoptions(threshold=numpy.nan)” 即使脚本运行了两个小时,它也不会终止,并且 test.txt 始终为空。
我该如何解决这个问题?谢谢。
【问题讨论】:
-
打印选项会影响
print o,但不会影响savetxt步骤。
标签: python numpy printing writefile