使用mnist.mat文件制作自定义数据集

时间:2020-04-30 09:50:32

标签: pytorch torch

我正在尝试从文件中显示图像,但由于无法读取而无法启动。 文件格式为.mat。我设法写了这样的东西:

    public void ConfigureServices(IServiceCollection services)
    {
        services.AddControllers(mvcOptions =>
            mvcOptions.EnableEndpointRouting = false);

        services.AddOData();
    }

    public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
    {
        if (env.IsDevelopment())
        {
            app.UseDeveloperExceptionPage();
        }

        app.UseHttpsRedirection();

        app.UseRouting();

        app.UseAuthorization();

        //app.UseEndpoints(endpoints =>
        //{
        //    endpoints.MapControllers();
        //});
        app.UseMvc(routeBuilder =>
        {
           // enable Selection, Expansion, Count, Filter, OrderBy for all routes under “odata/”
            routeBuilder.Expand().Select().Count().OrderBy().Filter();
            routeBuilder.MapODataServiceRoute("odata", "odata", GetEdmModel());
        });
    }

    private IEdmModel GetEdmModel()
    {
        var edmBuilder = new ODataConventionModelBuilder();
        edmBuilder.EntitySet<Student>("Students");

        return edmBuilder.GetEdmModel();
    }

除了使用datasets.MNIST以外,还有其他任何方法可以读取吗?

0 个答案:

没有答案