facebookresearch / nougat

Implementation of Nougat Neural Optical Understanding for Academic Documents
https://facebookresearch.github.io/nougat/
MIT License
8.98k stars 567 forks source link

开始能运行,后来就报错了 #65

Open davidli006 opened 1 year ago

davidli006 commented 1 year ago

ERROR: Exception in ASGI application Traceback (most recent call last): File "D:\Anaconda\lib\site-packages\uvicorn\protocols\http\httptools_impl.py", line 435, in run_asgi result = await app( # type: ignore[func-returns-value] File "D:\Anaconda\lib\site-packages\uvicorn\middleware\proxy_headers.py", line 78, in call return await self.app(scope, receive, send) File "D:\Anaconda\lib\site-packages\fastapi\applications.py", line 276, in call await super().call(scope, receive, send) File "D:\Anaconda\lib\site-packages\starlette\applications.py", line 122, in call await self.middleware_stack(scope, receive, send) File "D:\Anaconda\lib\site-packages\starlette\middleware\errors.py", line 184, in call raise exc File "D:\Anaconda\lib\site-packages\starlette\middleware\errors.py", line 162, in call await self.app(scope, receive, _send) File "D:\Anaconda\lib\site-packages\starlette\middleware\cors.py", line 92, in call await self.simple_response(scope, receive, send, request_headers=headers) File "D:\Anaconda\lib\site-packages\starlette\middleware\cors.py", line 147, in simple_response await self.app(scope, receive, send) File "D:\Anaconda\lib\site-packages\starlette\middleware\exceptions.py", line 79, in call raise exc File "D:\Anaconda\lib\site-packages\starlette\middleware\exceptions.py", line 68, in call await self.app(scope, receive, sender) File "D:\Anaconda\lib\site-packages\fastapi\middleware\asyncexitstack.py", line 21, in call raise e File "D:\Anaconda\lib\site-packages\fastapi\middleware\asyncexitstack.py", line 18, in call await self.app(scope, receive, send) File "D:\Anaconda\lib\site-packages\starlette\routing.py", line 718, in call await route.handle(scope, receive, send) File "D:\Anaconda\lib\site-packages\starlette\routing.py", line 276, in handle await self.app(scope, receive, send) File "D:\Anaconda\lib\site-packages\starlette\routing.py", line 66, in app response = await func(request) File "D:\Anaconda\lib\site-packages\fastapi\routing.py", line 237, in app raw_response = await run_endpoint_function( File "D:\Anaconda\lib\site-packages\fastapi\routing.py", line 163, in run_endpoint_function return await dependant.call(values) File "E:\github\nougat\app.py", line 130, in predict model_output = model.inference(image_tensors=sample) File "E:\github\nougat\nougat\model.py", line 577, in inference last_hidden_state = self.encoder(image_tensors) File "D:\Anaconda\lib\site-packages\torch\nn\modules\module.py", line 1110, in _call_impl return forward_call(*input, *kwargs) File "E:\github\nougat\nougat\model.py", line 123, in forward x = self.model.layers(x) File "D:\Anaconda\lib\site-packages\torch\nn\modules\module.py", line 1110, in _call_impl return forward_call(input, kwargs) File "D:\Anaconda\lib\site-packages\torch\nn\modules\container.py", line 141, in forward input = module(input) File "D:\Anaconda\lib\site-packages\torch\nn\modules\module.py", line 1110, in _call_impl return forward_call(*input, kwargs) File "D:\Anaconda\lib\site-packages\timm\models\swin_transformer.py", line 413, in forward x = blk(x) File "D:\Anaconda\lib\site-packages\torch\nn\modules\module.py", line 1110, in _call_impl return forward_call(*input, *kwargs) File "D:\Anaconda\lib\site-packages\timm\models\swin_transformer.py", line 295, in forward attn_windows = self.attn(x_windows, mask=self.attn_mask) # nWB, window_sizewindow_size, C File "D:\Anaconda\lib\site-packages\torch\nn\modules\module.py", line 1110, in _call_impl return forward_call(input, kwargs) File "D:\Anaconda\lib\site-packages\timm\models\swin_transformer.py", line 183, in forward attn = (q @ k.transpose(-2, -1)) RuntimeError: CUDA error: CUBLAS_STATUS_NOT_SUPPORTED when calling cublasGemmStridedBatchedExFix(handle, opa, opb, (int)m, (int)n, (int)k, (void*)&falpha, a, CUDA_R_16BF, (int)lda, stridea, b, CUDA_R_16BF, (int)ldb, strideb, (void*)&fbeta, c, CUDA_R_16BF, (int)ldc, stridec, (int)num_batches, CUDA_R_32F, CUBLAS_GEMM_DEFAULT_TENSOR_OP)