We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 15d4f8c + e054e64 commit 45c3f11Copy full SHA for 45c3f11
1 file changed
examples/mnist-learn/dataset.cpp
@@ -28,6 +28,12 @@
28
29
Dataset process_dataset(ModelDescription const& model_desc)
30
{
31
+ // Check if files exist.
32
+ if (!std::filesystem::exists(model_desc.images_file_path_))
33
+ throw std::runtime_error("Provided images file does not exists.");
34
+ else if (!std::filesystem::exists(model_desc.labels_file_path_))
35
+ throw std::runtime_error("Provided labels file does not exists.");
36
+
37
// Create streams for images and labels.
38
std::ifstream images_stream(model_desc.images_file_path_, std::ios::binary);
39
std::ifstream labels_stream(model_desc.labels_file_path_, std::ios::in);
0 commit comments