Closed leonwanghui closed 3 years ago
Hey @leonwanghui, first problem is you need to update the import of ImageReader
in your lenet_mindspore.py
.
Change
from jina.executors.crafters.image.io import ImageReader
to
from jina.hub.crafters.image.ImageReader import ImageReader
also you need to move the import of local lenet: From:
from ..lenet import LeNet5
import sys
sys.path.append('..')
To
import sys
sys.path.append('..')
from lenet import LeNet5
then make sure that you have all the installed
prerequisites for these lenet.py
file
@JoanFM Thanks for the help, and it works to remove the error msg, but another error occurred with the log below:
encode@8697[I]:setting up sockets...
encode@8697[I]:input tcp://0.0.0.0:33305 (PULL_BIND) output tcp://0.0.0.0:39185 (ROUTER_BIND) control over tcp://0.0.0.0:36137 (PAIR_BIND)
encode@8697[S]:ready and listening
encode@8702[I]:post initiating, this may take some time...
encode@8702[I]:post initiating, this may take some time takes 0 seconds (0.00s)
encode@8702[S]:successfully built BaseExecutor from a yaml config
encode@8702[I]:setting up sockets...
JINA@8702[E]:error when binding port 54279 to 0.0.0.0
encode@8702[I]:#sent: 0 #recv: 0 sent_size: 0 Bytes recv_size: 0 Bytes
encode@8702[E]:failed to stop. 'ZmqStreamlet' object has no attribute 'io_loop'
encode@8702[C]:zmqlet can not be initiated
encode@8702[S]:terminated
encode@8617[C]:fail to start <class 'jina.peapods.tail_pea.TailPea'> with name encode-tail, this often means the executor used in the pod is not valid
Traceback (most recent call last):
File "app.py", line 59, in <module>
main()
File "/root/miniconda3/envs/mindspore/lib/python3.7/site-packages/click/core.py", line 829, in __call__
return self.main(*args, **kwargs)
File "/root/miniconda3/envs/mindspore/lib/python3.7/site-packages/click/core.py", line 782, in main
rv = self.invoke(ctx)
File "/root/miniconda3/envs/mindspore/lib/python3.7/site-packages/click/core.py", line 1066, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/root/miniconda3/envs/mindspore/lib/python3.7/site-packages/click/core.py", line 610, in invoke
return callback(*args, **kwargs)
File "app.py", line 43, in main
with f:
File "/root/miniconda3/envs/mindspore/lib/python3.7/site-packages/jina/flow/__init__.py", line 444, in __enter__
return self.start()
File "/root/miniconda3/envs/mindspore/lib/python3.7/site-packages/jina/flow/__init__.py", line 500, in start
self.enter_context(v)
File "/root/miniconda3/envs/mindspore/lib/python3.7/contextlib.py", line 427, in enter_context
result = _cm_type.__enter__(cm)
File "/root/miniconda3/envs/mindspore/lib/python3.7/site-packages/jina/peapods/pod.py", line 254, in __enter__
return self.start()
File "/root/miniconda3/envs/mindspore/lib/python3.7/site-packages/jina/peapods/pod.py", line 388, in start
return super().start()
File "/root/miniconda3/envs/mindspore/lib/python3.7/site-packages/jina/peapods/pod.py", line 210, in start
self.enter_context(p)
File "/root/miniconda3/envs/mindspore/lib/python3.7/contextlib.py", line 427, in enter_context
result = _cm_type.__enter__(cm)
File "/root/miniconda3/envs/mindspore/lib/python3.7/site-packages/jina/peapods/pea.py", line 425, in __enter__
return self.start()
File "/root/miniconda3/envs/mindspore/lib/python3.7/site-packages/jina/peapods/pea.py", line 418, in start
raise PeaFailToStart
jina.excepts.PeaFailToStart
encode@8617[C]:fail to start <class 'jina.peapods.tail_pea.TailPea'> with name encode-tail, this often means the executor used in the pod is not valid
Looks like you maybe provided a custom name somewhere in your .yml files where you shouldn't have.
Can you post your configs?
can you try putting a higher timeout_ready
setting to a larger value for your encode pod?
encode@8617[C]:fail to start <class 'jina.peapods.tail_pea.TailPea'> with name encode-tail, this often means the executor used in the pod is not valid
Looks like you maybe provided a custom name somewhere in your .yml files where you shouldn't have.
Can you post your configs?
@cristianmtr The config could be found at: https://github.com/leonwanghui/mindspore-jina-apps/tree/main/lenet-fashion_mnist/pods
can you try putting a higher
timeout_ready
setting to a larger value for your encode pod?
@JoanFM I'm afraid the query operation hasn't been executed, since the error has occurred when I run python app.py -t index
.
yes, but the encoding is independent, it is also used during index
operations
yes, but the encoding is independent, it is also used during
index
operations
@JoanFM After setting timeout_ready
to 100000
, the zmqlite error was gone, but instead there comes another error in index.yml
:
index@11437[I]:post initiating, this may take some time...
index@11437[I]:post initiating, this may take some time takes 0 seconds (0.00s)
index@11437[S]:successfully built BaseExecutor from a yaml config
index@11437[I]:setting up sockets...
index@11437[I]:input tcp://0.0.0.0:44493 (PULL_BIND) output tcp://0.0.0.0:48641 (ROUTER_BIND) control over tcp://0.0.0.0:50361 (PAIR_BIND)
index@11437[S]:ready and listening
index@11442[I]:post initiating, this may take some time...
index@11442[I]:post initiating, this may take some time takes 0 seconds (0.00s)
index@11442[S]:successfully built BaseExecutor from a yaml config
index@11442[I]:setting up sockets...
index@11442[I]:input tcp://0.0.0.0:43925 (PULL_BIND) output tcp://0.0.0.0:39125 (PUSH_BIND) control over tcp://0.0.0.0:38411 (PAIR_BIND)
index@11442[S]:ready and listening
index@11447[I]:post initiating, this may take some time...
index@11447[I]:post initiating, this may take some time takes 0 seconds (0.00s)
index@11447[S]:successfully built NumpyIndexer from a yaml config
index@11447[I]:post initiating, this may take some time...
index@11447[I]:post initiating, this may take some time takes 0 seconds (0.00s)
index@11447[S]:successfully built BinaryPbIndexer from a yaml config
index@11447[I]:post initiating, this may take some time...
index@11447[I]:post initiating, this may take some time takes 0 seconds (0.00s)
index@11447[S]:successfully built CompoundIndexer from a yaml config
index@11447[S]:memmap is enabled for /tmp/jina/fashion_mnist/gaqxbfha/chunk_indexer-1/vec.gz
index@11447[C]:unknown exception: TypeError("unsupported operand type(s) for *: 'int' and 'NoneType'")
Traceback (most recent call last):
File "/root/miniconda3/envs/mindspore/lib/python3.7/site-packages/jina/peapods/pea.py", line 348, in run
self.loop_body()
File "/root/miniconda3/envs/mindspore/lib/python3.7/site-packages/jina/peapods/pea.py", line 329, in loop_body
self.load_executor()
File "/root/miniconda3/envs/mindspore/lib/python3.7/site-packages/jina/peapods/pea.py", line 200, in load_executor
self.args.separated_workspace, self.args.pea_id)
File "/root/miniconda3/envs/mindspore/lib/python3.7/site-packages/jina/executors/__init__.py", line 433, in load_config
return yaml.load(tmp_s)
File "/root/miniconda3/envs/mindspore/lib/python3.7/site-packages/ruamel/yaml/main.py", line 343, in load
return constructor.get_single_data()
File "/root/miniconda3/envs/mindspore/lib/python3.7/site-packages/ruamel/yaml/constructor.py", line 113, in get_single_data
return self.construct_document(node)
File "/root/miniconda3/envs/mindspore/lib/python3.7/site-packages/ruamel/yaml/constructor.py", line 118, in construct_document
data = self.construct_object(node)
File "/root/miniconda3/envs/mindspore/lib/python3.7/site-packages/ruamel/yaml/constructor.py", line 146, in construct_object
data = self.construct_non_recursive_object(node)
File "/root/miniconda3/envs/mindspore/lib/python3.7/site-packages/ruamel/yaml/constructor.py", line 181, in construct_non_recursive_object
data = constructor(self, node)
File "/root/miniconda3/envs/mindspore/lib/python3.7/site-packages/jina/executors/compound.py", line 352, in from_yaml
obj.components = lambda: data['components']
File "/root/miniconda3/envs/mindspore/lib/python3.7/site-packages/jina/executors/compound.py", line 258, in components
self._set_routes()
File "/root/miniconda3/envs/mindspore/lib/python3.7/site-packages/jina/executors/compound.py", line 308, in _set_routes
for m, _ in inspect.getmembers(c, predicate=inspect.ismethod):
File "/root/miniconda3/envs/mindspore/lib/python3.7/inspect.py", line 341, in getmembers
value = getattr(object, key)
File "/root/miniconda3/envs/mindspore/lib/python3.7/site-packages/jina/helper.py", line 667, in __get__
value = obj.__dict__[f'CACHED_{self.func.__name__}'] = self.func(obj)
File "/root/miniconda3/envs/mindspore/lib/python3.7/site-packages/jina/executors/indexers/__init__.py", line 83, in query_handler
r = self.get_query_handler()
File "/root/miniconda3/envs/mindspore/lib/python3.7/site-packages/jina/executors/indexers/vector.py", line 126, in get_query_handler
vecs = self.raw_ndarray
File "/root/miniconda3/envs/mindspore/lib/python3.7/site-packages/jina/helper.py", line 667, in __get__
value = obj.__dict__[f'CACHED_{self.func.__name__}'] = self.func(obj)
File "/root/miniconda3/envs/mindspore/lib/python3.7/site-packages/jina/executors/indexers/vector.py", line 157, in raw_ndarray
return np.memmap(self.index_abspath, dtype=self.dtype, mode='r', shape=(self.size, self.num_dim))
File "/root/miniconda3/envs/mindspore/lib/python3.7/site-packages/numpy/core/memmap.py", line 245, in __new__
size *= k
TypeError: unsupported operand type(s) for *: 'int' and 'NoneType'
index@11447[S]:terminated
index@11315[C]:fail to start <class 'jina.peapods.pea.BasePea'> with name index-1, this often means the executor used in the pod is not valid
Traceback (most recent call last):
File "app.py", line 58, in <module>
main()
File "/root/miniconda3/envs/mindspore/lib/python3.7/site-packages/click/core.py", line 829, in __call__
return self.main(*args, **kwargs)
File "/root/miniconda3/envs/mindspore/lib/python3.7/site-packages/click/core.py", line 782, in main
rv = self.invoke(ctx)
File "/root/miniconda3/envs/mindspore/lib/python3.7/site-packages/click/core.py", line 1066, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/root/miniconda3/envs/mindspore/lib/python3.7/site-packages/click/core.py", line 610, in invoke
return callback(*args, **kwargs)
File "app.py", line 42, in main
with f:
File "/root/miniconda3/envs/mindspore/lib/python3.7/site-packages/jina/flow/__init__.py", line 444, in __enter__
return self.start()
File "/root/miniconda3/envs/mindspore/lib/python3.7/site-packages/jina/flow/__init__.py", line 500, in start
self.enter_context(v)
File "/root/miniconda3/envs/mindspore/lib/python3.7/contextlib.py", line 427, in enter_context
result = _cm_type.__enter__(cm)
File "/root/miniconda3/envs/mindspore/lib/python3.7/site-packages/jina/peapods/pod.py", line 254, in __enter__
return self.start()
File "/root/miniconda3/envs/mindspore/lib/python3.7/site-packages/jina/peapods/pod.py", line 388, in start
return super().start()
File "/root/miniconda3/envs/mindspore/lib/python3.7/site-packages/jina/peapods/pod.py", line 224, in start
self.enter_context(p)
File "/root/miniconda3/envs/mindspore/lib/python3.7/contextlib.py", line 427, in enter_context
result = _cm_type.__enter__(cm)
File "/root/miniconda3/envs/mindspore/lib/python3.7/site-packages/jina/peapods/pea.py", line 425, in __enter__
return self.start()
File "/root/miniconda3/envs/mindspore/lib/python3.7/site-packages/jina/peapods/pea.py", line 418, in start
raise PeaFailToStart
jina.excepts.PeaFailToStart
Thanks!
Describe your problem
I was trying to execute the jina examples of mindspore-lenet with jinahub, after getting some help from John, I modified the code and push it to my personal code repo. But when I tried to execute
python app.py -t index
, some errors occurred with the log below:Would be appreciated if anyone could offer some help for trouble-shooting, thanks!
What is your guess?
Firstly I think it's the problem of version inconsistency, but even if I upgraded the
jina[hub]
version to0.7.0
, the error is still there.Maybe it's because the code has been deprecated and needs some update, but considering I'm new to this project, it would be difficult to debug and update the source code.
Environment
jina 0.7.0 jina-proto 0.0.65 jina-vcs-tag (unset) libzmq 4.3.2 pyzmq 1.18.4 protobuf 3.13.0 proto-backend cpp grpcio 1.32.0 ruamel.yaml 0.16.12 python 3.7.5 platform Linux platform-release 4.15.0-65-generic platform-version #74-Ubuntu SMP Tue Sep 17 17:06:04 UTC 2019 architecture x86_64 processor x86_64 jina-resources /root/miniconda3/envs/mindspore/lib/python3.7/site-packages/jina/resources JINA_ARRAY_QUANT (unset) JINA_BINARY_DELIMITER (unset) JINA_CONTRIB_MODULE (unset) JINA_CONTRIB_MODULE_IS_LOADING(unset) JINA_CONTROL_PORT (unset) JINA_DB_COLLECTION (unset) JINA_DB_HOSTNAME (unset) JINA_DB_NAME (unset) JINA_DB_PASSWORD (unset) JINA_DB_USERNAME (unset) JINA_DEFAULT_HOST (unset) JINA_DISABLE_UVLOOP (unset) JINA_EXECUTOR_WORKDIR (unset) JINA_FULL_CLI (unset) JINA_IPC_SOCK_TMP (unset) JINA_LOG_CONFIG (unset) JINA_LOG_NO_COLOR (unset) JINA_POD_NAME (unset) JINA_PROFILING (unset) JINA_RANDOM_PORTS (unset) JINA_SOCKET_HWM (unset) JINA_TEST_GPU (unset) JINA_TEST_PRETRAINED (unset) JINA_VCS_VERSION (unset) JINA_WARN_UNNAMED (unset)
Screenshots