如何在picloud上使用opencv?
这个简单的numpy测试工作
import cloud
import numpy as np
import time
data= np.random.rand(100,4)
t0= time.time()
job_id= cloud.call(np.dot,data,data.T)
cloud.join(job_id)
res= cloud.result(job_id)
print (time.time()-t0)
print res.shape
t0= time.time()
res= np.dot(data,data.T)
print (time.time()-t0)
print res.shape
但这不是
import cv
im= cv.LoadImage("D:\\001_001.tif")
t0= time.time()
job_id= cloud.call(cv.Smooth,im,im)
cloud.join(job_id)
res= cloud.result(job_id)
print (time.time()-t0)
错误
Traceback (most recent call last):
File "D:\test_cloud.py", line 13,
in <module>
cloud.join(job_id)
File "C:\Python27\lib\site-packages\cloud\cloud.py", line 721, in join
neededJids = filter_xrange_list(resultFilter, neededJids)
File "C:\Python27\lib\site-packages\cloud\util\xrange_helper.py", line 167, in
filter_xrange_list
if func(elm):
File "C:\Python27\lib\site-packages\cloud\cloud.py", line 719, in resultFilter
return filterJob(jid, status) # filter out done jobs; raise exception on err
ored jobs
File "C:\Python27\lib\site-packages\cloud\cloud.py", line 668, in filterJob
raise CloudException(exception, jid=jid, status=status, hint=hint)
cloud.cloud.CloudException: Job 8: Fatal Python error: Segmentation fault
Current thread 0x00007f162e1d3720:
File "/usr/local/picloud/.employee/pimployee/job_util.py", line 136 in process
_job
File "/usr/local/picloud/.employee/job_task.py", line 74 in <module>
TIP: It looks like your program crashed. If it is not clear how to solve this, p
lease file a support ticket (https://www.picloud.com/accounts/support/).
更新:也无法使用cv2界面。
import cv2
im= cv2.imread("D:\\001_001.tif")
t0= time.time()
job_id= cloud.call(cv2.blur,im,im)
cloud.join(job_id)
res= cloud.result(job_id)
print (time.time()-t0)
答案 0 :(得分:0)
而不是:
import cv
im= cv.LoadImage("D:\\001_001.tif")
你应该使用:
import cv2
im= cv2.imread("D:\\001_001.tif")
通常避免使用过时的cv模块,它在下一版本的opencv中无法使用