Skip to content

Instantly share code, notes, and snippets.

@himself65
Created June 29, 2022 23:46
Show Gist options
  • Save himself65/a5163f506ec39d707a9bc494cd49b783 to your computer and use it in GitHub Desktop.
Save himself65/a5163f506ec39d707a9bc494cd49b783 to your computer and use it in GitHub Desktop.
throw error
INFO: 192.168.31.144:52267 - "POST /sentence_classification HTTP/1.1" 500 Internal Server Error
ERROR: Exception in ASGI application
Traceback (most recent call last):
File "/home/labelray/Code/NLP_server/venv/lib/python3.10/site-packages/uvicorn/protocols/http/httptools_impl.py", line 401, in run_asgi
result = await app(self.scope, self.receive, self.send)
File "/home/labelray/Code/NLP_server/venv/lib/python3.10/site-packages/uvicorn/middleware/proxy_headers.py", line 78, in __call__
return await self.app(scope, receive, send)
File "/home/labelray/Code/NLP_server/venv/lib/python3.10/site-packages/fastapi/applications.py", line 269, in __call__
await super().__call__(scope, receive, send)
File "/home/labelray/Code/NLP_server/venv/lib/python3.10/site-packages/starlette/applications.py", line 124, in __call__
await self.middleware_stack(scope, receive, send)
File "/home/labelray/Code/NLP_server/venv/lib/python3.10/site-packages/starlette/middleware/errors.py", line 184, in __call__
raise exc
File "/home/labelray/Code/NLP_server/venv/lib/python3.10/site-packages/starlette/middleware/errors.py", line 162, in __call__
await self.app(scope, receive, _send)
File "/home/labelray/Code/NLP_server/venv/lib/python3.10/site-packages/starlette/middleware/cors.py", line 84, in __call__
await self.app(scope, receive, send)
File "/home/labelray/Code/NLP_server/venv/lib/python3.10/site-packages/starlette/exceptions.py", line 93, in __call__
raise exc
File "/home/labelray/Code/NLP_server/venv/lib/python3.10/site-packages/starlette/exceptions.py", line 82, in __call__
await self.app(scope, receive, sender)
File "/home/labelray/Code/NLP_server/venv/lib/python3.10/site-packages/fastapi/middleware/asyncexitstack.py", line 21, in __call__
raise e
File "/home/labelray/Code/NLP_server/venv/lib/python3.10/site-packages/fastapi/middleware/asyncexitstack.py", line 18, in __call__
await self.app(scope, receive, send)
File "/home/labelray/Code/NLP_server/venv/lib/python3.10/site-packages/starlette/routing.py", line 670, in __call__
await route.handle(scope, receive, send)
File "/home/labelray/Code/NLP_server/venv/lib/python3.10/site-packages/starlette/routing.py", line 266, in handle
await self.app(scope, receive, send)
File "/home/labelray/Code/NLP_server/venv/lib/python3.10/site-packages/starlette/routing.py", line 65, in app
response = await func(request)
File "/home/labelray/Code/NLP_server/venv/lib/python3.10/site-packages/fastapi/routing.py", line 227, in app
raw_response = await run_endpoint_function(
File "/home/labelray/Code/NLP_server/venv/lib/python3.10/site-packages/fastapi/routing.py", line 160, in run_endpoint_function
return await dependant.call(**values)
File "/home/labelray/Code/NLP_server/./main.py", line 56, in post_sentence_classification
return NLP_methods.sentence_classification.SentenceClassifier(train, eval).pipe()
File "/home/labelray/Code/NLP_server/./NLP_methods/sentence_classification.py", line 15, in __init__
self.model = transformers.TFRobertaForSequenceClassification.from_pretrained('./.cache/roberta-base')
File "/home/labelray/Code/NLP_server/venv/lib/python3.10/site-packages/transformers/modeling_tf_utils.py", line 1979, in from_pretrained
model(model.dummy_inputs) # build the network with dummy inputs
File "/home/labelray/Code/NLP_server/venv/lib/python3.10/site-packages/keras/utils/traceback_utils.py", line 67, in error_handler
raise e.with_traceback(filtered_tb) from None
File "/home/labelray/Code/NLP_server/venv/lib/python3.10/site-packages/transformers/modeling_tf_utils.py", line 389, in run_call_with_unpacked_inputs
return func(self, **unpacked_inputs)
File "/home/labelray/Code/NLP_server/venv/lib/python3.10/site-packages/transformers/models/roberta/modeling_tf_roberta.py", line 1359, in call
outputs = self.roberta(
File "/home/labelray/Code/NLP_server/venv/lib/python3.10/site-packages/transformers/modeling_tf_utils.py", line 389, in run_call_with_unpacked_inputs
return func(self, **unpacked_inputs)
File "/home/labelray/Code/NLP_server/venv/lib/python3.10/site-packages/transformers/models/roberta/modeling_tf_roberta.py", line 737, in call
encoder_outputs = self.encoder(
File "/home/labelray/Code/NLP_server/venv/lib/python3.10/site-packages/transformers/models/roberta/modeling_tf_roberta.py", line 534, in call
layer_outputs = layer_module(
File "/home/labelray/Code/NLP_server/venv/lib/python3.10/site-packages/transformers/models/roberta/modeling_tf_roberta.py", line 443, in call
self_attention_outputs = self.attention(
File "/home/labelray/Code/NLP_server/venv/lib/python3.10/site-packages/transformers/models/roberta/modeling_tf_roberta.py", line 356, in call
self_outputs = self.self_attention(
File "/home/labelray/Code/NLP_server/venv/lib/python3.10/site-packages/transformers/models/roberta/modeling_tf_roberta.py", line 245, in call
mixed_query_layer = self.query(inputs=hidden_states)
tensorflow.python.framework.errors_impl.InternalError: Exception encountered when calling layer "query" (type Dense).
Failed initializing math mode [Op:MatMul]
Call arguments received by layer "query" (type Dense):
• inputs=tf.Tensor(shape=(3, 5, 768), dtype=float32)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment