# TinyYolo is not working?

**URL:** https://community.konduit.ai/t/tinyyolo-is-not-working/1216
**Category:** DL4J
**Created:** [March 3, 2021, 1:01pm UTC](https://community.konduit.ai/t/tinyyolo-is-not-working/1216 "2021-03-03T13:01:54Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![nikkisingh111333](https://yyz1.discourse-cdn.com/flex035/user_avatar/community.konduit.ai/nikkisingh111333/32/461_2.png) [@nikkisingh111333](https://community.konduit.ai/u/nikkisingh111333)
#### Post date: [March 3, 2021, 1:01pm UTC](https://community.konduit.ai/t/tinyyolo-is-not-working/1216/1 "2021-03-03T13:01:54Z")

</div>

hey guys ,i m using tiny yolo and it throwing me this error while importing:

```nohighlight
Exception in thread "main" org.deeplearning4j.exception.DL4JInvalidConfigException: 
Invalid configuration for layer (idx=-1, name=convolution2d_2, type=ConvolutionLayer) 
for width dimension:  
Invalid input configuration for kernel width.
Require 0 < kW <= inWidth + 2*padW; got (kW=3, inWidth=2, padW=0) 
Input type = InputTypeConvolutional(h=208,w=2,c=16,NCHW), 
kernel = [3, 3], 
strides = [1, 1],
padding = [0, 0], 
layer size (output channels) = 32, 
convolution mode = Same

```

heres my code:

```java
String filename = "C:\\Users\\Nikki singh\\Downloads\\tiny-yolo-voc.h5"; 
ComputationGraph graph = KerasModelImport.importKerasModelAndWeights(filename, false); 

double[][] priorBoxes = {{2, 2}, {2, 2}, {2, 2}, {2, 2}, {2, 2}};
INDArray priors = Nd4j.create( priorBoxes);

FineTuneConfiguration fineTuneConf = new FineTuneConfiguration.Builder() 
.seed(123) 
.optimizationAlgo(OptimizationAlgorithm.STOCHASTIC_GRADIENT_DESCENT) 
.gradientNormalization(GradientNormalization.RenormalizeL2PerLayer) 
.gradientNormalizationThreshold(1.0) 
.updater(new Adam.Builder().learningRate(1e-3).build()) 
.l2(0.00001) 
.activation(Activation.IDENTITY) 
.trainingWorkspaceMode(WorkspaceMode.ENABLED) 
.inferenceWorkspaceMode(WorkspaceMode.ENABLED) 
.build();

ComputationGraph model = new TransferLearning.GraphBuilder(graph) 
.fineTuneConfiguration(fineTuneConf) 
.addLayer("outputs", new Yolo2OutputLayer.Builder() 
    .boundingBoxPriors(priors) 
    .build(), "conv2d_9") 
.setOutputs("outputs") .build();

System.out.println(model.summary(InputType.convolutional(130,130, 3)));
ModelSerializer.writeModel(model, "C:\\Users\\Nikki singh\\Downloads\\tiny-yolo-voc_dl4j_inference.v1.zip", false);

```

Error is on SecondLine here

```java
 ComputationGraph graph = KerasModelImport.importKerasModelAndWeights(filename, false); 

```

what i m doing wrong …

Model can be downloaded from this link [https://github.com/hollance/YOLO-CoreML-MPSNNGraph/blob/master/Convert/yad2k/model\_data/tiny-yolo-voc.h5](https://github.com/hollance/YOLO-CoreML-MPSNNGraph/blob/master/Convert/yad2k/model_data/tiny-yolo-voc.h5)

---

<div class="post-metadata">

### Author: ![treo](https://yyz1.discourse-cdn.com/flex035/user_avatar/community.konduit.ai/treo/32/47_2.png) [@treo](https://community.konduit.ai/u/treo)
#### Post date: [March 3, 2021, 1:16pm UTC](https://community.konduit.ai/t/tinyyolo-is-not-working/1216/2 "2021-03-03T13:16:01Z")

</div>

I’ve edited you post to be more readable.

As for your question: The error tells you in detail what the problem is. The model says it expects something with width 2 while simultaneously using kernels that are bigger than that.

I’d suggest that you import the model in keras, and output its structure there, to see what exact layer is the problem there.

@agibsonccc take a look at this, might be another edge case you want to check for the new import.

---

<div class="post-metadata">

### Author: ![nikkisingh111333](https://yyz1.discourse-cdn.com/flex035/user_avatar/community.konduit.ai/nikkisingh111333/32/461_2.png) [@nikkisingh111333](https://community.konduit.ai/u/nikkisingh111333)
#### Post date: [March 3, 2021, 5:05pm UTC](https://community.konduit.ai/t/tinyyolo-is-not-working/1216/3 "2021-03-03T17:05:32Z")

</div>

i dont understand is the model is currupt or i m doing it wrong ?..I m not a python devloper i have track all layers of the model in netron can you please suggest me valid way to import Keras in deep4j and Valid model too any link to that model…???
