doccano AttributeError: type object 'CustomRESTRequestModel' has no attribute 'model_json_schema'

aiqt4smr  于 6个月前  发布在  其他
关注(0)|答案(1)|浏览(53)

当你在Anaconda Prompt窗口中输入"doccano task"时,出现了一个错误。这个错误是由于在auto_labeling_pipeline/menu.py文件的第46行中,试图访问CustomRESTRequestModel类型对象的model_json_schema属性,但是该类型对象没有这个属性导致的。

为了解决这个问题,你需要检查CustomRESTRequestModel类的定义,并确保它具有model_json_schema属性。如果该属性不存在,你需要添加它或者修改代码以避免访问不存在的属性。
这段文本是一个Python程序的错误输出,它显示了在运行Celery任务时发生了一个错误。具体来说,这个错误发生在C:\Users\HYX\anaconda3\Lib\site-packages\celery\app.py文件的第110行。错误类型是FileNotFoundError,表示找不到指定的文件或目录。

错误信息如下:

File "C:\Users\HYX\anaconda3\Lib\site-packages\backend\cli.py", line 110, in command_run_task_queue
 app.worker_main(argv=argv)
 File "C:\Users\HYX\anaconda3\Lib\site-packages\celery\app.py", line 389, in worker_main
 self.start(argv=argv)
 File "C:\Users\HYX\anaconda3\Lib\site-packages\celery\app.py", line 369, in start
 celery.main(args=argv, standalone_mode=False)
 File "C:\Users\HYX\anaconda3\Lib\site-packages\click\core.py", line 1078, in main
 rv = self.invoke(ctx)
 File "C:\Users\HYX\anaconda3\Lib\site-packages\click\core.py", line 1688, in invoke
 return _process_subcommand(ctx.command.invoke(ctx))
 File "C:\Users\HYX\anaconda3\Lib\site-packages\click\core.py", line 1434, in invoke
 return ctx.invoke(self.callback, **ctx.params)
 File "C:\Users\HYX\anaconda3\Lib\site-packages\celery\bin\base.py", line 134, in caller
 return f(ctx, *args, **kwargs)
 File "C:\Users\HYX\anaconda3\Lib\site-packages\celery\worker.py", line 93, in **init
 self.app.loader.init_worker()
 File "C:\Users\HYX\anaconda3\Lib\site-packages\celery\loaders\base.py", line 110, in init_worker
 self.import_default_modules()
 File "C:\Users\HYX\anaconda3\Lib\site-packages\celery\fixups\django.py", line 97, in on_import_modules
 self.worker_fixup.validate_models()
 File "C:\Users\HYX\anaconda3\Lib\site-packages\celery\fixups\django.py", line 137, in validate_models
 run_checks()
 File "C:\Users\HYX\anaconda3\Lib\site-packages\django\corechecks/registry.py", line 88, in run_checks
 new_errors = check(app_configs=app_configs, databases=databases)
 File "C:\Users\HYX\anaconda3\Lib\site-packages\django>corechecks>urls.py", line 14, in check_url_resolver
 return check_resolver(resolver)
 File "C:\Users\HYX\anaconda3\Lib
文件 "C:\Users\HYXanaconda3Lib\site-packagesbackend\auto_labelingviews.py",第6行,从 auto_labeling_pipeline.menu 导入 Options
文件 "C:\Users\HYX\anaconda3\Lib\site-packages\auto_labeling_pipeline\menu.py",第58行,Options.register(
文件 "C:\Users\HYX\anaconda3\Libsite-packages\auto_labeling_pipeline\menu.py",第46行,在 register 中
schema = model.model_json_schema()
^^^^^^^^^^^^^^^^^^^^^^^
AttributeError:类型对象 'CustomRESTRequestModel' 没有属性 'model_json_schema'

相关问题