Open vvolhejn opened 6 years ago
Try putting absolute paths in your obj.data file?
On Thu, Aug 30, 2018 at 2:19 AM Václav Volhejn notifications@github.com wrote:
When running detector test from a different directory than the project root (so something like darknet/darknet detector test [...]), there are a lot of errors of this sort:
STB Reason: can't fopen Cannot load image "data/labels/123_7.png" STB Reason: can't fopen Cannot load image "data/labels/124_7.png" STB Reason: can't fopen Cannot load image "data/labels/125_7.png" STB Reason: can't fopen Cannot load image "data/labels/126_7.png" STB Reason: can't fopen [...omitted...] STB Reason: can't fopen Cannot load image "data/labels/123_7.png" STB Reason: can't fopen Cannot load image "data/labels/124_7.png" STB Reason: can't fopen Cannot load image "data/labels/125_7.png" STB Reason: can't fopen Cannot load image "data/labels/126_7.png" STB Reason: can't fopen
after which the command performs predictions as expected, apart from the fact that the displayed prediction bounding boxes have no labels (they don't say which class is predicted).
I have tracked this down to the load_alphabet() function in image.c https://github.com/AlexeyAB/darknet/blob/master/src/image.c#L217, which attempts to load images of characters from a fixed relative path, disregarding the fact that we may run the command from elsewhere.
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/AlexeyAB/darknet/issues/1514, or mute the thread https://github.com/notifications/unsubscribe-auth/ARocJQfKZDm9AP0wSvFPIKl8RUIh1Hnnks5uV64qgaJpZM4WTF7Y .
-- Peter Quinn (415) 794-2264 (cell)
The paths in my .data
file are absolute; this is almost certainly not the source of the error. The paths in the error messages (data/labels/125_7.png
etc) correspond to the load_alphabet()
function trying to load pre-rendered images of ASCII characters.
as @AlexeyAB mentioned here, you should change two lines (1602 and 1771) at darknet/src/detector.c including the following code:
image **alphabet = load_alphabet();
to:
image **alphabet = NULL;
Also, you should run make
command in darknet folder
When running
detector test
from a different directory than the project root (so something likedarknet/darknet detector test [...]
), there are a lot of errors of this sort:after which the command performs predictions as expected, apart from the fact that the displayed prediction bounding boxes have no labels (they don't say which class is predicted).
I have tracked this down to the
load_alphabet()
function inimage.c
, which attempts to load images of characters from a fixed relative path, disregarding the fact that we may run the command from elsewhere.