File ' .jpg' does not exist

17 ビュー (過去 30 日間)
Niculai Traian
Niculai Traian 2019 年 7 月 3 日
編集済み: DGM 2022 年 1 月 30 日
Hello, i am trying to do an rcnn tutorial, https://www.mathworks.com/help/vision/examples/object-detection-using-deep-learning.html using my data set and options, but after i finish training i cant test the rcnn.
This is the error
Error using imread>get_full_filename (line 568)
File "image_01964.jpg" does not exist.
Error in imread (line 377)
fullname = get_full_filename(filename);
Error in roi (line 26)
testImage = imread('image_01964.jpg');
And i am using this for reading the image i want to test.
testImage = imread('image_01964.jpg');
% Detect stop signs
[bboxes,score,label] = detect(rcnn,testImage,'MiniBatchSize',128)
The files are all in same folder, i made sure the name is correct.
  2 件のコメント
KALYAN ACHARJYA
KALYAN ACHARJYA 2019 年 7 月 3 日
testImage = imread('image_01964.jpg');
% Detect stop signs
[bboxes,score,label] = detect(rcnn,testImage,'MiniBatchSize',128)
Second part, is this OK??
Adam
Adam 2019 年 7 月 3 日
It's much safer and easier to use full file paths for data you are loading rather than assume it is in the current directory (which, usually, is not an ideal place for data to live anyway)

サインインしてコメントする。

採用された回答

KALYAN ACHARJYA
KALYAN ACHARJYA 2019 年 7 月 3 日
ww.png
Ensure that image file in the last folder name as shown in directory path.
  3 件のコメント
Mustapha Seidu
Mustapha Seidu 2022 年 1 月 30 日
Hi, I'm facing this same problem but I do not understand the suggestion here. Can you explain further? Thanks.
DGM
DGM 2022 年 1 月 30 日
編集済み: DGM 2022 年 1 月 30 日
If you are only providing a filename:
A = imread('mypicture.jpg');
then mypicture.jpg must exist on the MATLAB search path or in the current working directory. If the file isn't in any of the places that MATLAB is already looking for files, then it obviously won't find it.
Either you have to ensure that the file is on the search path, or in the current directory as Kalyan suggests, or as Adam suggests above, you need to specify the full path and filename.
fpath = '/data/path/to/mybigpileofpictures/';
fname = 'mypicture.jpg';
A = imread(fullfile(fpath,fname));

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeImage Data Workflows についてさらに検索

製品


リリース

R2018b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by