[GH-ISSUE #7386] Llama 3.2 vision EOF error #51205

Closed
opened 2026-04-28 18:54:55 -05:00 by GiteaMirror · 3 comments
Owner

Originally created by @cyb3r17 on GitHub (Oct 27, 2024).
Original GitHub issue: https://github.com/ollama/ollama/issues/7386

What is the issue?

ollama run x/llama3.2-vision and then adding an image file via the path gives the following error
Error: POST predict: Post "http://127.0.0.1:42649/completion": EOF via CLI and ollama-python (assuming the same on the API endpoints as well?)

OS

Linux

GPU

Nvidia

CPU

AMD

Ollama version

0.4.0-rc5

Originally created by @cyb3r17 on GitHub (Oct 27, 2024). Original GitHub issue: https://github.com/ollama/ollama/issues/7386 ### What is the issue? `ollama run x/llama3.2-vision` and then adding an image file via the path gives the following error Error: POST predict: Post "http://127.0.0.1:42649/completion": EOF via CLI and ollama-python (assuming the same on the API endpoints as well?) ### OS Linux ### GPU Nvidia ### CPU AMD ### Ollama version 0.4.0-rc5
GiteaMirror added the bug label 2026-04-28 18:54:55 -05:00
Author
Owner

@rick-github commented on GitHub (Oct 28, 2024):

Confirm that files added via the CLI fail, but the same files work via the API:

$ ollama:0.4.0-rc5 run x/llama3.2-vision describe this image: ./puppy.jpg
Added image './puppy.jpg'
Error: POST predict: Post "http://127.0.0.1:45799/completion": EOF
$ (echo '{"model":"x/llama3.2-vision","messages":[{"role":"user","content":"describe this image","images":["' ; base64 -w0 puppy.jpg ; echo '"]}],"stream":false}') | curl -s localhost:11434/api/chat -d @- | jq
{
  "model": "x/llama3.2-vision",
  "created_at": "2024-10-28T00:51:50.353573692Z",
  "message": {
    "role": "assistant",
    "content": "The image features a small, white puppy sitting on a stone surface. The puppy is positioned in the center of the frame and faces to the right, with its head slightly turned towards the camera. It has short, fluffy fur that appears to be either pure white or very light-colored, making it difficult to discern any darker markings.\n\nThe puppy's ears are folded back against its head, giving it a cute and endearing appearance. A small red collar encircles its neck, adorned with a shiny gold bell that adds a touch of elegance to the overall scene.\n\nIn the background, the stone surface on which the puppy sits is visible, although it is out of focus. The surrounding environment is blurred, drawing attention solely to the puppy and creating a sense of intimacy and closeness. Overall, the image presents a heartwarming and adorable portrait of a small white puppy, exuding innocence and charm."
  },
  "done_reason": "stop",
  "done": true,
  "total_duration": 13245621575,
  "load_duration": 7305927740,
  "prompt_eval_count": 13,
  "prompt_eval_duration": 2258000000,
  "eval_count": 181,
  "eval_duration": 3601000000
}

Interactive:

ollama  | time=2024-10-28T00:51:00.756Z level=DEBUG source=llama-server.go:582 msg="model load completed, waiting for server to become available" status="llm server loading model"
ollama  | mllama_model_load: compute allocated memory: 2853.34 MB
ollama  | time=2024-10-28T00:51:01.259Z level=INFO source=llama-server.go:573 msg="llama runner started in 2.26 seconds"
ollama  | time=2024-10-28T00:51:01.259Z level=DEBUG source=sched.go:463 msg="finished setting up runner" model=/root/.ollama/models/blobs/sha256-652e85aa1e14c9087a4ccc3ab516fb794cbcf152f8b4b8d3c0b828da4ada62d9
ollama  | time=2024-10-28T00:51:01.259Z level=DEBUG source=routes.go:251 msg="generate request" prompt="<|start_header_id|>user<|end_header_id|>\n\n<|image|>\n\ndescribe this image:<|eot_id|><|start_header_id|>assistant<|end_header_id|>\n\n" images="[{Data:[255 216 255 224 0 16 74 70 73 70 0 1 1 2 ... 219 179 255 217] ID:0 AspectRatioID:0}]"
ollama  | SIGSEGV: segmentation violation
ollama  | PC=0x7cf86a990f80 m=7 sigcode=2 addr=0x7cf7d8036000
ollama  | signal arrived during cgo execution
ollama  | 
ollama  | goroutine 18 gp=0xc00021e000 m=7 mp=0xc000180808 [syscall]:
ollama  | runtime.cgocall(0x5f8e7577fdd0, 0xc0001f9368)
ollama  |       runtime/cgocall.go:157 +0x4b fp=0xc0001f9340 sp=0xc0001f9308 pc=0x5f8e755032cb
ollama  | github.com/ollama/ollama/llama._Cfunc_mllama_image_encode(0x7cf7d18d2640, 0x8, 0x7cf7d8000e30, 0xc000300000)
ollama  |       _cgo_gotypes.go:898 +0x4c fp=0xc0001f9368 sp=0xc0001f9340 pc=0x5f8e75601eec
ollama  | github.com/ollama/ollama/llama.NewMllamaImageEmbed.func5(0x7cf7d8000e30?, 0x0?, 0x7cf7d8000e30, {0xc000300000, 0xc0001b6100?, 0xc0001f9458?})
ollama  |       github.com/ollama/ollama/llama/llama.go:504 +0xa9 fp=0xc0001f93c0 sp=0xc0001f9368 pc=0x5f8e75605889
ollama  | github.com/ollama/ollama/llama.NewMllamaImageEmbed(0xc000208160, 0xc00020c4e0, {0xc0002a2000, 0xd0a2, 0xd0a4}, 0x0)
ollama  |       github.com/ollama/ollama/llama/llama.go:504 +0x179 fp=0xc0001f9468 sp=0xc0001f93c0 pc=0x5f8e75605679
ollama  | main.(*Server).inputs(0xc0000ce120, {0xc0002b0090, 0x82}, {0xc00019c5d0, 0x1, 0x5f8e755617c5?})
ollama  |       github.com/ollama/ollama/llama/runner/runner.go:220 +0x4df fp=0xc0001f9600 sp=0xc0001f9468 pc=0x5f8e7577957f
ollama  | main.(*Server).NewSequence(0xc0000ce120, {0xc0002b0090, 0x82}, {0xc00019c5d0, 0x1, 0x1}, {0x5000, {0x0, 0x0, 0x0}, ...})
ollama  |       github.com/ollama/ollama/llama/runner/runner.go:100 +0xb2 fp=0xc0001f97b8 sp=0xc0001f9600 pc=0x5f8e757788f2
ollama  | main.(*Server).completion(0xc0000ce120, {0x5f8e75ab7870, 0xc0001ac2a0}, 0xc00019e240)
ollama  |       github.com/ollama/ollama/llama/runner/runner.go:628 +0x52a fp=0xc0001f9ab8 sp=0xc0001f97b8 pc=0x5f8e7577bd6a
ollama  | main.(*Server).completion-fm({0x5f8e75ab7870?, 0xc0001ac2a0?}, 0x5f8e75757a6d?)
ollama  |       <autogenerated>:1 +0x36 fp=0xc0001f9ae8 sp=0xc0001f9ab8 pc=0x5f8e7577f076
ollama  | net/http.HandlerFunc.ServeHTTP(0xc0000b2c30?, {0x5f8e75ab7870?, 0xc0001ac2a0?}, 0x10?)
ollama  |       net/http/server.go:2171 +0x29 fp=0xc0001f9b10 sp=0xc0001f9ae8 pc=0x5f8e75750509
ollama  | net/http.(*ServeMux).ServeHTTP(0x5f8e7550ce85?, {0x5f8e75ab7870, 0xc0001ac2a0}, 0xc00019e240)
ollama  |       net/http/server.go:2688 +0x1ad fp=0xc0001f9b60 sp=0xc0001f9b10 pc=0x5f8e7575238d
ollama  | net/http.serverHandler.ServeHTTP({0x5f8e75ab6bc0?}, {0x5f8e75ab7870?, 0xc0001ac2a0?}, 0x6?)
ollama  |       net/http/server.go:3142 +0x8e fp=0xc0001f9b90 sp=0xc0001f9b60 pc=0x5f8e757533ae
ollama  | net/http.(*conn).serve(0xc000218000, {0x5f8e75ab7c90, 0xc0000b0db0})
ollama  |       net/http/server.go:2044 +0x5e8 fp=0xc0001f9fb8 sp=0xc0001f9b90 pc=0x5f8e7574f148
ollama  | net/http.(*Server).Serve.gowrap3()
ollama  |       net/http/server.go:3290 +0x28 fp=0xc0001f9fe0 sp=0xc0001f9fb8 pc=0x5f8e75753b28
ollama  | runtime.goexit({})
ollama  |       runtime/asm_amd64.s:1695 +0x1 fp=0xc0001f9fe8 sp=0xc0001f9fe0 pc=0x5f8e7556bce1
ollama  | created by net/http.(*Server).Serve in goroutine 1
ollama  |       net/http/server.go:3290 +0x4b4

API:

ollama  | time=2024-10-28T00:51:44.162Z level=DEBUG source=llama-server.go:582 msg="model load completed, waiting for server to become available" status="llm server loading model"
ollama  | mllama_model_load: compute allocated memory: 2853.34 MB
ollama  | time=2024-10-28T00:51:44.413Z level=INFO source=llama-server.go:573 msg="llama runner started in 2.01 seconds"
ollama  | time=2024-10-28T00:51:44.413Z level=DEBUG source=sched.go:463 msg="finished setting up runner" model=/root/.ollama/models/blobs/sha256-652e85aa1e14c9087a4ccc3ab516fb794cbcf152f8b4b8d3c0b828da4ada62d9
ollama  | time=2024-10-28T00:51:44.459Z level=DEBUG source=routes.go:1434 msg="chat request" images=1 prompt="<|start_header_id|>user<|end_header_id|>\n\n<|image|>describe this image<|eot_id|><|start_header_id|>assistant<|end_header_id|>\n\n"
ollama  | time=2024-10-28T00:51:46.652Z level=DEBUG source=cache.go:261 msg="storing image embeddings in cache" entry=0 used=0001-01-01T00:00:00.000Z

It looks like the interactive call is embedding the raw picture data in the image parameter, while the API call is passing a reference/id to the image.

<!-- gh-comment-id:2440280203 --> @rick-github commented on GitHub (Oct 28, 2024): Confirm that files added via the CLI fail, but the same files work via the API: ```console $ ollama:0.4.0-rc5 run x/llama3.2-vision describe this image: ./puppy.jpg Added image './puppy.jpg' Error: POST predict: Post "http://127.0.0.1:45799/completion": EOF $ (echo '{"model":"x/llama3.2-vision","messages":[{"role":"user","content":"describe this image","images":["' ; base64 -w0 puppy.jpg ; echo '"]}],"stream":false}') | curl -s localhost:11434/api/chat -d @- | jq { "model": "x/llama3.2-vision", "created_at": "2024-10-28T00:51:50.353573692Z", "message": { "role": "assistant", "content": "The image features a small, white puppy sitting on a stone surface. The puppy is positioned in the center of the frame and faces to the right, with its head slightly turned towards the camera. It has short, fluffy fur that appears to be either pure white or very light-colored, making it difficult to discern any darker markings.\n\nThe puppy's ears are folded back against its head, giving it a cute and endearing appearance. A small red collar encircles its neck, adorned with a shiny gold bell that adds a touch of elegance to the overall scene.\n\nIn the background, the stone surface on which the puppy sits is visible, although it is out of focus. The surrounding environment is blurred, drawing attention solely to the puppy and creating a sense of intimacy and closeness. Overall, the image presents a heartwarming and adorable portrait of a small white puppy, exuding innocence and charm." }, "done_reason": "stop", "done": true, "total_duration": 13245621575, "load_duration": 7305927740, "prompt_eval_count": 13, "prompt_eval_duration": 2258000000, "eval_count": 181, "eval_duration": 3601000000 } ``` Interactive: ``` ollama | time=2024-10-28T00:51:00.756Z level=DEBUG source=llama-server.go:582 msg="model load completed, waiting for server to become available" status="llm server loading model" ollama | mllama_model_load: compute allocated memory: 2853.34 MB ollama | time=2024-10-28T00:51:01.259Z level=INFO source=llama-server.go:573 msg="llama runner started in 2.26 seconds" ollama | time=2024-10-28T00:51:01.259Z level=DEBUG source=sched.go:463 msg="finished setting up runner" model=/root/.ollama/models/blobs/sha256-652e85aa1e14c9087a4ccc3ab516fb794cbcf152f8b4b8d3c0b828da4ada62d9 ollama | time=2024-10-28T00:51:01.259Z level=DEBUG source=routes.go:251 msg="generate request" prompt="<|start_header_id|>user<|end_header_id|>\n\n<|image|>\n\ndescribe this image:<|eot_id|><|start_header_id|>assistant<|end_header_id|>\n\n" images="[{Data:[255 216 255 224 0 16 74 70 73 70 0 1 1 2 ... 219 179 255 217] ID:0 AspectRatioID:0}]" ollama | SIGSEGV: segmentation violation ollama | PC=0x7cf86a990f80 m=7 sigcode=2 addr=0x7cf7d8036000 ollama | signal arrived during cgo execution ollama | ollama | goroutine 18 gp=0xc00021e000 m=7 mp=0xc000180808 [syscall]: ollama | runtime.cgocall(0x5f8e7577fdd0, 0xc0001f9368) ollama | runtime/cgocall.go:157 +0x4b fp=0xc0001f9340 sp=0xc0001f9308 pc=0x5f8e755032cb ollama | github.com/ollama/ollama/llama._Cfunc_mllama_image_encode(0x7cf7d18d2640, 0x8, 0x7cf7d8000e30, 0xc000300000) ollama | _cgo_gotypes.go:898 +0x4c fp=0xc0001f9368 sp=0xc0001f9340 pc=0x5f8e75601eec ollama | github.com/ollama/ollama/llama.NewMllamaImageEmbed.func5(0x7cf7d8000e30?, 0x0?, 0x7cf7d8000e30, {0xc000300000, 0xc0001b6100?, 0xc0001f9458?}) ollama | github.com/ollama/ollama/llama/llama.go:504 +0xa9 fp=0xc0001f93c0 sp=0xc0001f9368 pc=0x5f8e75605889 ollama | github.com/ollama/ollama/llama.NewMllamaImageEmbed(0xc000208160, 0xc00020c4e0, {0xc0002a2000, 0xd0a2, 0xd0a4}, 0x0) ollama | github.com/ollama/ollama/llama/llama.go:504 +0x179 fp=0xc0001f9468 sp=0xc0001f93c0 pc=0x5f8e75605679 ollama | main.(*Server).inputs(0xc0000ce120, {0xc0002b0090, 0x82}, {0xc00019c5d0, 0x1, 0x5f8e755617c5?}) ollama | github.com/ollama/ollama/llama/runner/runner.go:220 +0x4df fp=0xc0001f9600 sp=0xc0001f9468 pc=0x5f8e7577957f ollama | main.(*Server).NewSequence(0xc0000ce120, {0xc0002b0090, 0x82}, {0xc00019c5d0, 0x1, 0x1}, {0x5000, {0x0, 0x0, 0x0}, ...}) ollama | github.com/ollama/ollama/llama/runner/runner.go:100 +0xb2 fp=0xc0001f97b8 sp=0xc0001f9600 pc=0x5f8e757788f2 ollama | main.(*Server).completion(0xc0000ce120, {0x5f8e75ab7870, 0xc0001ac2a0}, 0xc00019e240) ollama | github.com/ollama/ollama/llama/runner/runner.go:628 +0x52a fp=0xc0001f9ab8 sp=0xc0001f97b8 pc=0x5f8e7577bd6a ollama | main.(*Server).completion-fm({0x5f8e75ab7870?, 0xc0001ac2a0?}, 0x5f8e75757a6d?) ollama | <autogenerated>:1 +0x36 fp=0xc0001f9ae8 sp=0xc0001f9ab8 pc=0x5f8e7577f076 ollama | net/http.HandlerFunc.ServeHTTP(0xc0000b2c30?, {0x5f8e75ab7870?, 0xc0001ac2a0?}, 0x10?) ollama | net/http/server.go:2171 +0x29 fp=0xc0001f9b10 sp=0xc0001f9ae8 pc=0x5f8e75750509 ollama | net/http.(*ServeMux).ServeHTTP(0x5f8e7550ce85?, {0x5f8e75ab7870, 0xc0001ac2a0}, 0xc00019e240) ollama | net/http/server.go:2688 +0x1ad fp=0xc0001f9b60 sp=0xc0001f9b10 pc=0x5f8e7575238d ollama | net/http.serverHandler.ServeHTTP({0x5f8e75ab6bc0?}, {0x5f8e75ab7870?, 0xc0001ac2a0?}, 0x6?) ollama | net/http/server.go:3142 +0x8e fp=0xc0001f9b90 sp=0xc0001f9b60 pc=0x5f8e757533ae ollama | net/http.(*conn).serve(0xc000218000, {0x5f8e75ab7c90, 0xc0000b0db0}) ollama | net/http/server.go:2044 +0x5e8 fp=0xc0001f9fb8 sp=0xc0001f9b90 pc=0x5f8e7574f148 ollama | net/http.(*Server).Serve.gowrap3() ollama | net/http/server.go:3290 +0x28 fp=0xc0001f9fe0 sp=0xc0001f9fb8 pc=0x5f8e75753b28 ollama | runtime.goexit({}) ollama | runtime/asm_amd64.s:1695 +0x1 fp=0xc0001f9fe8 sp=0xc0001f9fe0 pc=0x5f8e7556bce1 ollama | created by net/http.(*Server).Serve in goroutine 1 ollama | net/http/server.go:3290 +0x4b4 ``` API: ``` ollama | time=2024-10-28T00:51:44.162Z level=DEBUG source=llama-server.go:582 msg="model load completed, waiting for server to become available" status="llm server loading model" ollama | mllama_model_load: compute allocated memory: 2853.34 MB ollama | time=2024-10-28T00:51:44.413Z level=INFO source=llama-server.go:573 msg="llama runner started in 2.01 seconds" ollama | time=2024-10-28T00:51:44.413Z level=DEBUG source=sched.go:463 msg="finished setting up runner" model=/root/.ollama/models/blobs/sha256-652e85aa1e14c9087a4ccc3ab516fb794cbcf152f8b4b8d3c0b828da4ada62d9 ollama | time=2024-10-28T00:51:44.459Z level=DEBUG source=routes.go:1434 msg="chat request" images=1 prompt="<|start_header_id|>user<|end_header_id|>\n\n<|image|>describe this image<|eot_id|><|start_header_id|>assistant<|end_header_id|>\n\n" ollama | time=2024-10-28T00:51:46.652Z level=DEBUG source=cache.go:261 msg="storing image embeddings in cache" entry=0 used=0001-01-01T00:00:00.000Z ``` It looks like the interactive call is embedding the raw picture data in the `image` parameter, while the API call is passing a reference/id to the image.
Author
Owner

@rick-github commented on GitHub (Oct 28, 2024):

Works for the interactive session, which uses /api/chat:

$ ollama:0.4.0-rc5 run x/llama3.2-vision
>>> describe this image: ./puppy.jpg
Added image './puppy.jpg'
The image features a small, white puppy sitting on a stone surface. The puppy is positioned in the center of the frame, facing to the right and looking slightly downward. It has short, fluffy fur that 
appears to be either white or light gray, with a black nose and dark eyes. A red collar encircles its neck, adorned with a small gold bell.

The puppy's posture suggests it is sitting comfortably on the stone surface, which occupies most of the image. The background behind the puppy is blurred, but it appears to be an outdoor setting, possibly 
a patio or courtyard, given the presence of stone flooring and the natural light illuminating the scene. Overall, the image presents a serene and intimate moment, capturing the puppy's calm demeanor as it 
sits on its stone perch.

>>> 

So likely related to https://github.com/ollama/ollama/issues/7362.

<!-- gh-comment-id:2440363161 --> @rick-github commented on GitHub (Oct 28, 2024): Works for the interactive session, which uses `/api/chat`: ```console $ ollama:0.4.0-rc5 run x/llama3.2-vision >>> describe this image: ./puppy.jpg Added image './puppy.jpg' The image features a small, white puppy sitting on a stone surface. The puppy is positioned in the center of the frame, facing to the right and looking slightly downward. It has short, fluffy fur that appears to be either white or light gray, with a black nose and dark eyes. A red collar encircles its neck, adorned with a small gold bell. The puppy's posture suggests it is sitting comfortably on the stone surface, which occupies most of the image. The background behind the puppy is blurred, but it appears to be an outdoor setting, possibly a patio or courtyard, given the presence of stone flooring and the natural light illuminating the scene. Overall, the image presents a serene and intimate moment, capturing the puppy's calm demeanor as it sits on its stone perch. >>> ``` So likely related to https://github.com/ollama/ollama/issues/7362.
Author
Owner

@cyb3r17 commented on GitHub (Oct 28, 2024):

alright, marking as closed to reduce spam since issue has already been reported

<!-- gh-comment-id:2441441569 --> @cyb3r17 commented on GitHub (Oct 28, 2024): alright, marking as closed to reduce spam since issue has already been reported
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/ollama#51205