Я работаю со знаменитым Yolo Dar knet Github fork Ссылка здесь! : я уже тренировал весы и хочу запустить его на удаленном сервере (с Ubuntu) клиента формы (windows машина с профессиональной настройкой pycharm через s sh для удаленного интерпретатора):
In:
command=['/usr/local/primestone/darknet/darknet', 'detector','test\
','/usr/local/primestone/darknet/data/custom_data/obj.data','/usr/local/primestone/darknet\
/data/custom_data/yolo-obj.cfg','/usr/local/primestone/darknet/backup/yolo-obj_best.weights','-ext_output', '-dont_show']
pdf_pages=<wand.image.Image: 3546cae 'JPG' (2480x3506)># Wand.Image.Image object(I don't want to save it)
class RcogPipe():
def __init__(self,command,pdf_pages):
print('class: RecogPipe has received following command\n\
\nand following:pdf pageNo:',command,pdf_pages)
'''
input: (list; every sapce in linux command is list element)\
to send the command to darknet model via shh server\
from remote.
commnad is darknet command
output: output is the output of darkent model with -ext_output argument
'''
send_job = Popen(command, stdin=PIPE, stdout=PIPE,stderr=PIPE, universal_newlines=True)
self.out=send_job.communicate(pdf_pages)
print('Darknet model internal view:\n',self.out[0])
#return out[0]
Out:
I am getting this error:
Traceback (most recent call last):
File "/usr/local/primestone/docrecog/pycharm_ws/Test_perd/model_run.py", line 67, in <module>
m=model_run(cmd,file)
File "/usr/local/primestone/docrecog/pycharm_ws/Test_perd/model_run.py", line 50, in model_run
cls=RcogPipe(dn_cmd,pg)
File "/usr/local/primestone/docrecog/pycharm_ws/Test_perd/recog_main.py", line 32, in __init__
self.out=send_job.communicate(pdf_pages)
File "/usr/lib/python3.6/subprocess.py", line 863, in communicate
stdout, stderr = self._communicate(input, endtime, timeout)
File "/usr/lib/python3.6/subprocess.py", line 1516, in _communicate
self._save_input(input)
File "/usr/lib/python3.6/subprocess.py", line 1592, in _save_input
self._input = self._input.encode(self.stdin.encoding,
AttributeError: 'Image' object has no attribute 'encode'
Exception ignored in: Exception ignored in: <object repr() failed>
Traceback (most recent call last):
File "/usr/local/primestone/docrecog/venv/lib/python3.6/site-packages/wand/cdefs/wandtypes.py", line 33, in __del__
TypeError: 'NoneType' object is not callable
Exception ignored in: <object repr() failed>
Traceback (most recent call last):
File "/usr/local/primestone/docrecog/venv/lib/python3.6/site-packages/wand/cdefs/wandtypes.py", line 33, in __del__
TypeError: 'NoneType' object is not callable
<bound method Resource.__del__ of <wand.image.Image: 3546cae 'JPG' (2480x3506)>>
Traceback (most recent call last):
File "/usr/local/primestone/docrecog/venv/lib/python3.6/site-packages/wand/resource.py", line 253, in __del__
File "/usr/local/primestone/docrecog/venv/lib/python3.6/site-packages/wand/image.py", line 8589, in destroy
File "/usr/lib/python3.6/_collections_abc.py", line 996, in pop
File "/usr/local/primestone/docrecog/venv/lib/python3.6/site-packages/wand/sequence.py", line 111, in __getitem__
File "/usr/local/primestone/docrecog/venv/lib/python3.6/site-packages/wand/sequence.py", line 76, in validate_position
TypeError: isinstance() arg 2 must be a type or tuple of types
Что уже работает
Однако, если я сохраню Сначала создайте изображение в рабочем каталоге и вызовите его из каталога с именем пути, оно работает нормально.
Будем благодарны за любые предложения и помощь. На это уже потрачен целый день!