Skip to content

Error of free(): double free detected in tcache2 was found when running with fastapi server #230

Description

@lmw0320

I just use the follwing code to provide a http server for testing:
`import yaml
import uvicorn
from fastapi import FastAPI, UploadFile, File
from model_task.models.layout_detection.yolo import LayoutDetectionYOLO

app = FastAPI()

with open('config.yaml', 'r', encoding= 'utf8') as file:
config = yaml.safe_load(file)
layout_config = config['tasks']['layout_detection']['model_config']
layout_model = LayoutDetectionYOLO(layout_config)

@app.post("/test")
async def test_inference(file: UploadFile = File()):
image = await file.read()
ori_layout_res = layout_model.predict([image])[0]
return {"result": ori_layout_res}

if name == 'main':
uvicorn.run(app='main:app', host='0.0.0.0', port=15000)
`
but got the error as below:

Image I don't know why ...Hope someone can help, thanks in advance!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions