I’m currently running a workflow with inference on a local server (Running using the downloadable Roboflow App). However, when I run the Python API inference script made available from the Deploy tab in the Roboflow Workflow, I encounter the following error:
raise HTTPCallErrorError(
inference_sdk.http.errors.HTTPCallErrorError: HTTPCallErrorError(
description='500 Server Error: Internal Server Error for url: https://serverless.roboflow.com/dikshants-blog-workspace/workflows/background-blurring-workflow',
api_message='Cannot use dynamic blocks with custom Python code in this installation of workflows. This can be changed by setting the environment variable ALLOW_CUSTOM_PYTHON_EXECUTION_IN_WORKFLOWS=True. More details: None',
status_code=500
)
This is the script I’m using:
from inference_sdk import InferenceHTTPClient
client = InferenceHTTPClient(
api_url="https://serverless.roboflow.com",
api_key="XXXXXXXXXXXXXX"
)
result = client.run_workflow(
workspace_name="dikshants-blog-workspace",
workflow_id="background-blurring-workflow",
images={
"image": "./first_frame.jpg"
},
parameters={
"kernel_size": 81,
"blur_type": "gaussian"
},
use_cache=True
)
The workflow runs correctly when I use it through the Roboflow UI at app.roboflow. I also tried adding the ALLOW_CUSTOM_PYTHON_EXECUTION_IN_WORKFLOWS
as environment variable as True
on my Windows machine. After setting it in the same PowerShell session that runs the Roboflow inference server, running $env:ALLOW_CUSTOM_PYTHON_EXECUTION_IN_WORKFLOWS
returns True
.