jina-ai / discoart

๐Ÿชฉ Create Disco Diffusion artworks in one line
Other
3.84k stars 249 forks source link

server discoart inside Docker error args: "unknown argument `__results__`, misspelled?" #67

Closed brokeDude2901 closed 2 years ago

brokeDude2901 commented 2 years ago

Hi, i'm having problems server Discoart with this error: on client:

Exception in thread Thread-20:
Traceback (most recent call last):
  File "/usr/lib/python3.7/threading.py", line 926, in _bootstrap_inner
    self.run()
  File "/usr/local/lib/python3.7/dist-packages/jina/helper.py", line 1292, in run
    self.result = asyncio.run(func(*args, **kwargs))
  File "/usr/lib/python3.7/asyncio/runners.py", line 43, in run
    return loop.run_until_complete(main)
  File "/usr/lib/python3.7/asyncio/base_events.py", line 587, in run_until_complete
    return future.result()
  File "/usr/local/lib/python3.7/dist-packages/jina/clients/mixin.py", line 176, in _get_results
    async for resp in c._get_results(*args, **kwargs):
  File "/usr/local/lib/python3.7/dist-packages/jina/clients/base/grpc.py", line 96, in _get_results
    logger=self.logger,
  File "/usr/local/lib/python3.7/dist-packages/jina/clients/helper.py", line 81, in callback_exec
    raise BadServer(response.header)
jina.excepts.BadServer: request_id: "bdf9ac7a4f164f06ae1e4adac3d2ab9d"
status {
  code: ERROR
  description: "AttributeError(\'unknown argument `__results__`, misspelled?\')"
  exception {
    name: "AttributeError"
    args: "unknown argument `__results__`, misspelled?"
    stacks: "Traceback (most recent call last):\n"
    stacks: "  File \"/usr/local/lib/python3.8/dist-packages/jina/serve/runtimes/worker/__init__.py\", line 165, in process_data\n    return await self._data_request_handler.handle(requests=requests)\n"
    stacks: "  File \"/usr/local/lib/python3.8/dist-packages/jina/serve/runtimes/request_handlers/data_request_handler.py\", line 155, in handle\n    return_data = await self._executor.__acall__(\n"
    stacks: "  File \"/usr/local/lib/python3.8/dist-packages/jina/serve/executors/__init__.py\", line 289, in __acall__\n    return await self.__acall_endpoint__(req_endpoint, **kwargs)\n"
    stacks: "  File \"/usr/local/lib/python3.8/dist-packages/jina/serve/executors/__init__.py\", line 310, in __acall_endpoint__\n    return await func(self, **kwargs)\n"
    stacks: "  File \"/usr/local/lib/python3.8/dist-packages/jina/serve/executors/decorators.py\", line 207, in arg_wrapper\n    return await fn(executor_instance, *args, **kwargs)\n"
    stacks: "  File \"/usr/local/lib/python3.8/dist-packages/discoart/executors.py\", line 14, in create_artworks\n    await asyncio.get_event_loop().run_in_executor(None, self._create, parameters)\n"
    stacks: "  File \"/usr/lib/python3.8/concurrent/futures/thread.py\", line 57, in run\n    result = self.fn(*self.args, **self.kwargs)\n"
    stacks: "  File \"/usr/local/lib/python3.8/dist-packages/discoart/executors.py\", line 19, in _create\n    return create(\n"
    stacks: "  File \"/usr/local/lib/python3.8/dist-packages/discoart/create.py\", line 166, in create\n    _args = load_config(user_config=kwargs)\n"
    stacks: "  File \"/usr/local/lib/python3.8/dist-packages/discoart/config.py\", line 36, in load_config\n    raise AttributeError(f\'unknown argument `{k}`, misspelled?\')\n"
    stacks: "AttributeError: unknown argument `__results__`, misspelled?\n"
    executor: "DiscoArtExecutor"
  }
}
exec_endpoint: "/create"

---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
[/usr/local/lib/python3.7/dist-packages/jina/helper.py](https://localhost:8080/#) in run_async(func, *args, **kwargs)
   1306             try:
-> 1307                 return thread.result
   1308             except AttributeError:

AttributeError: '_RunThread' object has no attribute 'result'

During handling of the above exception, another exception occurred:

BadClient                                 Traceback (most recent call last)
2 frames
[/usr/local/lib/python3.7/dist-packages/jina/helper.py](https://localhost:8080/#) in run_async(func, *args, **kwargs)
   1310 
   1311                 raise BadClient(
-> 1312                     'something wrong when running the eventloop, result can not be retrieved'
   1313                 )
   1314         else:

BadClient: something wrong when running the eventloop, result can not be retrieved

on server:

DEBUG  discoart/rep-0@17 recv DataRequest at /create with    [07/21/22 21:47:49]
       id: bdf9ac7a4f164f06ae1e4adac3d2ab9d
ERROR  discoart/rep-0@17 AttributeError('unknown argument
       `__results__`, misspelled?')
        add "--quiet-error" to suppress the exception
       details
       โ•ญโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ Traceback (most recent call last) โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฎ
       โ”‚ /usr/local/lib/python3.8/dist-packages/jina/servโ€ฆ โ”‚
       โ”‚ in process_data                                   โ”‚
       โ”‚                                                   โ”‚
       โ”‚   162 โ”‚   โ”‚   โ”‚   โ”‚   if self.logger.debug_enable โ”‚
       โ”‚   163 โ”‚   โ”‚   โ”‚   โ”‚   โ”‚   self._log_data_request( โ”‚
       โ”‚   164 โ”‚   โ”‚   โ”‚   โ”‚                               โ”‚
       โ”‚ โฑ 165 โ”‚   โ”‚   โ”‚   โ”‚   return await self._data_req โ”‚
       โ”‚   166 โ”‚   โ”‚   โ”‚   except (RuntimeError, Exception โ”‚
       โ”‚   167 โ”‚   โ”‚   โ”‚   โ”‚   self.logger.error(          โ”‚
       โ”‚   168 โ”‚   โ”‚   โ”‚   โ”‚   โ”‚   f'{ex!r}'               โ”‚
       โ”‚                                                   โ”‚
       โ”‚ /usr/local/lib/python3.8/dist-packages/jina/servโ€ฆ โ”‚
       โ”‚ in handle                                         โ”‚
       โ”‚                                                   โ”‚
       โ”‚   152 โ”‚   โ”‚   )                                   โ”‚
       โ”‚   153 โ”‚   โ”‚                                       โ”‚
       โ”‚   154 โ”‚   โ”‚   # executor logic                    โ”‚
       โ”‚ โฑ 155 โ”‚   โ”‚   return_data = await self._executor. โ”‚
       โ”‚   156 โ”‚   โ”‚   โ”‚   req_endpoint=requests[0].header โ”‚
       โ”‚   157 โ”‚   โ”‚   โ”‚   docs=docs,                      โ”‚
       โ”‚   158 โ”‚   โ”‚   โ”‚   parameters=params,              โ”‚
       โ”‚                                                   โ”‚
       โ”‚ /usr/local/lib/python3.8/dist-packages/jina/servโ€ฆ โ”‚
       โ”‚ in __acall__                                      โ”‚
       โ”‚                                                   โ”‚
       โ”‚   286 โ”‚   โ”‚   # noqa: DAR201                      โ”‚
       โ”‚   287 โ”‚   โ”‚   """                                 โ”‚
       โ”‚   288 โ”‚   โ”‚   if req_endpoint in self.requests:   โ”‚
       โ”‚ โฑ 289 โ”‚   โ”‚   โ”‚   return await self.__acall_endpo โ”‚
       โ”‚   290 โ”‚   โ”‚   elif __default_endpoint__ in self.r โ”‚
       โ”‚   291 โ”‚   โ”‚   โ”‚   return await self.__acall_endpo โ”‚
       โ”‚   292                                             โ”‚
       โ”‚                                                   โ”‚
       โ”‚ /usr/local/lib/python3.8/dist-packages/jina/servโ€ฆ โ”‚
       โ”‚ in __acall_endpoint__                             โ”‚
       โ”‚                                                   โ”‚
       โ”‚   307 โ”‚   โ”‚                                       โ”‚
       โ”‚   308 โ”‚   โ”‚   with _summary:                      โ”‚
       โ”‚   309 โ”‚   โ”‚   โ”‚   if iscoroutinefunction(func):   โ”‚
       โ”‚ โฑ 310 โ”‚   โ”‚   โ”‚   โ”‚   return await func(self, **k โ”‚
       โ”‚   311 โ”‚   โ”‚   โ”‚   else:                           โ”‚
       โ”‚   312 โ”‚   โ”‚   โ”‚   โ”‚   return func(self, **kwargs) โ”‚
       โ”‚   313                                             โ”‚
       โ”‚                                                   โ”‚
       โ”‚ /usr/local/lib/python3.8/dist-packages/jina/servโ€ฆ โ”‚
       โ”‚ in arg_wrapper                                    โ”‚
       โ”‚                                                   โ”‚
       โ”‚   204 โ”‚   โ”‚   โ”‚   โ”‚   async def arg_wrapper(      โ”‚
       โ”‚   205 โ”‚   โ”‚   โ”‚   โ”‚   โ”‚   executor_instance, *arg โ”‚
       โ”‚   206 โ”‚   โ”‚   โ”‚   โ”‚   ):  # we need to get the su โ”‚
       โ”‚       the self                                    โ”‚
       โ”‚ โฑ 207 โ”‚   โ”‚   โ”‚   โ”‚   โ”‚   return await fn(executo โ”‚
       โ”‚   208 โ”‚   โ”‚   โ”‚   โ”‚                               โ”‚
       โ”‚   209 โ”‚   โ”‚   โ”‚   โ”‚   self.fn = arg_wrapper       โ”‚
       โ”‚   210 โ”‚   โ”‚   โ”‚   else:                           โ”‚
       โ”‚                                                   โ”‚
       โ”‚ /usr/local/lib/python3.8/dist-packages/discoart/โ€ฆ โ”‚
       โ”‚ in create_artworks                                โ”‚
       โ”‚                                                   โ”‚
       โ”‚   11 โ”‚                                            โ”‚
       โ”‚   12 โ”‚   @requests(on='/create')                  โ”‚
       โ”‚   13 โ”‚   async def create_artworks(self, paramete โ”‚
       โ”‚ โฑ 14 โ”‚   โ”‚   await asyncio.get_event_loop().run_i โ”‚
       โ”‚   15 โ”‚                                            โ”‚
       โ”‚   16 โ”‚   def _create(self, parameters: Dict, **kw โ”‚
       โ”‚   17 โ”‚   โ”‚   from .create import create           โ”‚
       โ”‚                                                   โ”‚
       โ”‚ /usr/lib/python3.8/concurrent/futures/thread.py:โ€ฆ โ”‚
       โ”‚ in run                                            โ”‚
       โ”‚                                                   โ”‚
       โ”‚    54 โ”‚   โ”‚   โ”‚   return                          โ”‚
       โ”‚    55 โ”‚   โ”‚                                       โ”‚
       โ”‚    56 โ”‚   โ”‚   try:                                โ”‚
       โ”‚ โฑ  57 โ”‚   โ”‚   โ”‚   result = self.fn(*self.args, ** โ”‚
       โ”‚    58 โ”‚   โ”‚   except BaseException as exc:        โ”‚
       โ”‚    59 โ”‚   โ”‚   โ”‚   self.future.set_exception(exc)  โ”‚
       โ”‚    60 โ”‚   โ”‚   โ”‚   # Break a reference cycle with  โ”‚
       โ”‚                                                   โ”‚
       โ”‚ /usr/local/lib/python3.8/dist-packages/discoart/โ€ฆ โ”‚
       โ”‚ in _create                                        โ”‚
       โ”‚                                                   โ”‚
       โ”‚   16 โ”‚   def _create(self, parameters: Dict, **kw โ”‚
       โ”‚   17 โ”‚   โ”‚   from .create import create           โ”‚
       โ”‚   18 โ”‚   โ”‚                                        โ”‚
       โ”‚ โฑ 19 โ”‚   โ”‚   return create(                       โ”‚
       โ”‚   20 โ”‚   โ”‚   โ”‚   skip_event=self.skip_event, stop โ”‚
       โ”‚   21 โ”‚   โ”‚   )                                    โ”‚
       โ”‚   22                                              โ”‚
       โ”‚                                                   โ”‚
       โ”‚ /usr/local/lib/python3.8/dist-packages/discoart/โ€ฆ โ”‚
       โ”‚ in create                                         โ”‚
       โ”‚                                                   โ”‚
       โ”‚   163 โ”‚   โ”‚   โ”‚   _kwargs.update(kwargs)          โ”‚
       โ”‚   164 โ”‚   โ”‚   _args = load_config(user_config=_kw โ”‚
       โ”‚   165 โ”‚   else:                                   โ”‚
       โ”‚ โฑ 166 โ”‚   โ”‚   _args = load_config(user_config=kwa โ”‚
       โ”‚   167 โ”‚                                           โ”‚
       โ”‚   168 โ”‚   save_config_svg(_args)                  โ”‚
       โ”‚   169                                             โ”‚
       โ”‚                                                   โ”‚
       โ”‚ /usr/local/lib/python3.8/dist-packages/discoart/โ€ฆ โ”‚
       โ”‚ in load_config                                    โ”‚
       โ”‚                                                   โ”‚
       โ”‚    33 โ”‚                                           โ”‚
       โ”‚    34 โ”‚   for k in list(user_config.keys()):      โ”‚
       โ”‚    35 โ”‚   โ”‚   if k not in cfg and k not in ('_sta โ”‚
       โ”‚ โฑ  36 โ”‚   โ”‚   โ”‚   raise AttributeError(f'unknown  โ”‚
       โ”‚    37 โ”‚                                           โ”‚
       โ”‚    38 โ”‚   if user_config:                         โ”‚
       โ”‚    39 โ”‚   โ”‚   if user_config.get('cut_schedules_g โ”‚
       โ•ฐโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฏ
       AttributeError: unknown argument `__results__`,
       misspelled?

My docker command is:

sudo docker run --name discoart --rm -p 8888:8888 -p 51001:51001 \
-v $HOME/private/diffusion_stuff/discoart_flow.yml:/root/discoart_flow.yml \
-v $HOME/jupyter_workspace:/root/jupyter_workspace/ \
-v $HOME/.cache_discoart:/root/.cache --gpus all jinaai/discoart \
bash -c "python -m discoart serve /root/discoart_flow.yml"

my discoart_flow.yml is:

jtype: Flow
with:
  protocol: grpc
  monitoring: true
  port: 51001
  port_monitoring: 51002  # prometheus monitoring port
  env:
    JINA_LOG_LEVEL: debug
    DISCOART_DISABLE_IPYTHON: 1
    DISCOART_DISABLE_RESULT_SUMMARY: 1
executors:
  - name: discoart
    uses: DiscoArtExecutor
#    env:
#      CUDA_VISIBLE_DEVICES: RR0:3  # change this if you have multiple GPU
#    replicas: 3  # change this if you have larger VRAM
  - name: poller
    uses: ResultPoller

my client Python code:

from jina import Client

c = Client(host='grpc://myserver:51001')

da = c.post(
    '/create',
    parameter={
        'name_docarray': 'mydisco-123',
        'text_prompts': [
            'A beautiful painting of a singular lighthouse',
            'yellow color scheme',
        ],
    },
)
hanxiao commented 2 years ago

fixed and rolled out in 0.7.11