[GH-ISSUE #7553] Unable to load images from network fileshares on Windows #82488

Open
opened 2026-05-09 14:19:37 -05:00 by GiteaMirror · 4 comments
Owner

Originally created by @Antsiscool on GitHub (Nov 7, 2024).
Original GitHub issue: https://github.com/ollama/ollama/issues/7553

Originally assigned to: @dhiltgen on GitHub.

What is the issue?

Using Ollama on Windows via the terminal, if you ask a question and reference an image on a network fileshare, it will give a response about it not been able to see the photo. If you copy the image locally and then reference the local image, it has no problem with analysing the image.

Paths starting with \ will not load the image.

OS

Windows

GPU

Nvidia

CPU

AMD

Ollama version

0.4.0

Originally created by @Antsiscool on GitHub (Nov 7, 2024). Original GitHub issue: https://github.com/ollama/ollama/issues/7553 Originally assigned to: @dhiltgen on GitHub. ### What is the issue? Using Ollama on Windows via the terminal, if you ask a question and reference an image on a network fileshare, it will give a response about it not been able to see the photo. If you copy the image locally and then reference the local image, it has no problem with analysing the image. Paths starting with \\ will not load the image. ### OS Windows ### GPU Nvidia ### CPU AMD ### Ollama version 0.4.0
GiteaMirror added the bugwindows labels 2026-05-09 14:19:37 -05:00
Author
Owner

@rick-github commented on GitHub (Nov 7, 2024):

Does it work if you use "/" as path separator rather than "\"?

<!-- gh-comment-id:2462161502 --> @rick-github commented on GitHub (Nov 7, 2024): Does it work if you use "/" as path separator rather than "\\"?
Author
Owner

@Antsiscool commented on GitHub (Nov 8, 2024):

Yes, it works if I change all the backslashes to forward slashes.

It also works if you change the first double backwards slash to forwards slashes and leave the rest as back slashes.

<!-- gh-comment-id:2463876962 --> @Antsiscool commented on GitHub (Nov 8, 2024): Yes, it works if I change all the backslashes to forward slashes. It also works if you change the first double backwards slash to forwards slashes and leave the rest as back slashes.
Author
Owner

@Antsiscool commented on GitHub (Nov 10, 2024):

I have narrowed it down to this line of code: c2e8cbaa14/cmd/interactive.go (L509)

This is converting the double backslash to a single backslash.

package main
import "fmt"
import "strings"

func main() {
    fmt.Println("\\\\Network\\folder\\photo.jpg")
  fmt.Println(normalizeFilePath("\\\\Network\\folder\\photo.jpg"))
}


func normalizeFilePath(fp string) string {
	return strings.NewReplacer(
// 		"\\ ", " ", // Escaped space
// 		"\\(", "(", // Escaped left parenthesis
// 		"\\)", ")", // Escaped right parenthesis
// 		"\\[", "[", // Escaped left square bracket
// 		"\\]", "]", // Escaped right square bracket
// 		"\\{", "{", // Escaped left curly brace
// 		"\\}", "}", // Escaped right curly brace
// 		"\\$", "$", // Escaped dollar sign
// 		"\\&", "&", // Escaped ampersand
// 		"\\;", ";", // Escaped semicolon
// 		"\\'", "'", // Escaped single quote
		"\\\\", "\\", // Escaped backslash
// 		"\\*", "*", // Escaped asterisk
// 		"\\?", "?", // Escaped question mark
	).Replace(fp)
}

Outputs:

\\Network\folder\photo.jpg
\Network\folder\photo.jpg
<!-- gh-comment-id:2466680711 --> @Antsiscool commented on GitHub (Nov 10, 2024): I have narrowed it down to this line of code: https://github.com/ollama/ollama/blob/c2e8cbaa140986b6a27f2c795e2fb9b38e74f094/cmd/interactive.go#L509 This is converting the double backslash to a single backslash. ```go package main import "fmt" import "strings" func main() { fmt.Println("\\\\Network\\folder\\photo.jpg") fmt.Println(normalizeFilePath("\\\\Network\\folder\\photo.jpg")) } func normalizeFilePath(fp string) string { return strings.NewReplacer( // "\\ ", " ", // Escaped space // "\\(", "(", // Escaped left parenthesis // "\\)", ")", // Escaped right parenthesis // "\\[", "[", // Escaped left square bracket // "\\]", "]", // Escaped right square bracket // "\\{", "{", // Escaped left curly brace // "\\}", "}", // Escaped right curly brace // "\\$", "$", // Escaped dollar sign // "\\&", "&", // Escaped ampersand // "\\;", ";", // Escaped semicolon // "\\'", "'", // Escaped single quote "\\\\", "\\", // Escaped backslash // "\\*", "*", // Escaped asterisk // "\\?", "?", // Escaped question mark ).Replace(fp) } ``` Outputs: ``` \\Network\folder\photo.jpg \Network\folder\photo.jpg ```
Author
Owner

@CkovMk commented on GitHub (Nov 17, 2024):

Never tried using network path (\server\path), but when I map a network share to disk label, loading model from the network share works fine.

<!-- gh-comment-id:2481495280 --> @CkovMk commented on GitHub (Nov 17, 2024): Never tried using network path (\\server\path), but when I map a network share to disk label, loading model from the network share works fine.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/ollama#82488