Deep learning 在deeplearning4j中运行ResNet时出现异常
我试图运行deeplearning4j的ZooModel中提供的ResNet50计算图,但在调用resNet的init()方法时出现以下错误。我有10个类,每个图像是64*64 请建议正确的初始化方法 代码Deep learning 在deeplearning4j中运行ResNet时出现异常,deep-learning,deeplearning4j,Deep Learning,Deeplearning4j,我试图运行deeplearning4j的ZooModel中提供的ResNet50计算图,但在调用resNet的init()方法时出现以下错误。我有10个类,每个图像是64*64 请建议正确的初始化方法 代码 ResNet50Builder builder = ResNet50.builder(); ResNet50 resNet = builder.numClasses(10).cacheMode(CacheMode.NONE) .works
ResNet50Builder builder = ResNet50.builder();
ResNet50 resNet = builder.numClasses(10).cacheMode(CacheMode.NONE)
.workspaceMode(WorkspaceMode.NONE).inputShape(new int[] {3, 64, 64}).build();
ComputationGraph computationGraph = resNet.init();
异常堆栈跟踪:
Exception in thread "main" org.deeplearning4j.exception.DL4JInvalidConfigException: Invalid configuration for layer (idx=77, name=res4a_branch2b, type=ConvolutionLayer) for height dimension: Invalid input configuration for kernel height. Require 0 < kH <= inHeight + 2*padH; got (kH=3, inHeight=2, padH=0)
Input type = InputTypeConvolutional(h=2,w=2,c=256), kernel = [3, 3], strides = [1, 1], padding = [0, 0], layer size (output channels) = 256, convolution mode = Same
at org.deeplearning4j.nn.conf.layers.InputTypeUtil.getOutputTypeCnnLayers(InputTypeUtil.java:327)
at org.deeplearning4j.nn.conf.layers.ConvolutionLayer.getOutputType(ConvolutionLayer.java:191)
at org.deeplearning4j.nn.conf.graph.LayerVertex.getOutputType(LayerVertex.java:131)
at org.deeplearning4j.nn.conf.ComputationGraphConfiguration.getLayerActivationTypes(ComputationGraphConfiguration.java:536)
at org.deeplearning4j.nn.conf.ComputationGraphConfiguration.addPreProcessors(ComputationGraphConfiguration.java:449)
at org.deeplearning4j.nn.conf.ComputationGraphConfiguration$GraphBuilder.build(ComputationGraphConfiguration.java:1201)
at org.deeplearning4j.zoo.model.ResNet50.init(ResNet50.java:91)
at org.deeplearning4j.examples.convolution.ResNet.run(ResNet.java:145)
at org.deeplearning4j.examples.convolution.ResNet.main(ResNet.java:306)
线程“main”org.deeplearning4j.Exception.dl4jinValidConfigeException中的异常:高度维度的层(idx=77,name=res4a_branch2b,type=卷积层)配置无效:内核高度的输入配置无效。需要0