Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

Image classification training convert to onnx file format

Đang mở
#1,048 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
5/5
Thời gian dự kiến
Hơn một tuần
Mức phù hợp với người mới
25/100
Loại issue
Tính năng
Độ rõ ràng
Cần làm rõ
Mức độ hoạt động
Đình trệ
Công nghệ
csharp
Lĩnh vực
machine-learning

Hướng nghiên cứu

Bắt đầu với sample phân loại hình ảnh C# và entry point ConvertToOnnx, sau đó tái hiện exception bằng pipeline được trình bày trong issue. Xác định những stage nào có thể được biểu diễn trong ONNX và thống nhất behavior best-effort dự kiến; công việc được xem là hoàn tất khi conversion path được hỗ trợ hoặc capability được yêu cầu đã được xác định và minh họa cho sample này.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

I've been doing experiments with the C# image classification examples, and I've been struggling trying to modify the sample to save an ONNX file without success, since it gives me the usual "The targeted pipeline can not be fully converted into a well-defined ONNX model" exception.

So which would be the steps required to be able to save an onnx file?

I am aware some pipeline might contain ML transformers that are not available in ONNX, but maybe the ConvertToOnnx method could have a "best effort" option that would automatically convert what can be converted.

In other words, I would like to save the raw ONNX model that's in between the transformers that cannot be converted to ONNX.

var trainTestSplit = _mlContext.Data.TrainTestSplit(data, testFraction: 0.2);
var trainData = trainTestSplit.TrainSet;
var testData = trainTestSplit.TestSet;

var pipeline = _mlContext.Transforms.Conversion.MapValueToKey(
outputColumnName: "LabelKey",
inputColumnName: "Label")

.Append(_mlContext.Transforms.LoadRawImageBytes(
outputColumnName: "Image",
imageFolder: null,
inputColumnName: "ImagePath"))
.Append(_mlContext.MulticlassClassification.Trainers.ImageClassification(
new ImageClassificationTrainer.Options()
{
LabelColumnName = "LabelKey",
FeatureColumnName = "Image",
Arch = ImageClassificationTrainer.Architecture.InceptionV3,
Epoch = _settings.Epochs,
BatchSize = _settings.BatchSize,
LearningRate = 0.001f,
MetricsCallback = (metrics) => _logger.LogInformation($"Epoch: {metrics.Train?.Epoch}, Top1Accuracy: {metrics.Train?.Accuracy}")
}))
.Append(_mlContext.Transforms.Conversion.MapKeyToValue(
outputColumnName: "PredictedLabel",
inputColumnName: "PredictedLabel"));

Ngôn ngữ chính
PowerShell
Star
4.7k
Fork
2.7k
Merge trung bình
2 ngày 22 giờ
Pull request đã merge (30 ngày)
1

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của dotnet/machinelearning-samples

Tất cả issue của dotnet/machinelearning-samples

Issue tương tự

Thêm issue về Machine Learning

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.