Created
November 13, 2017 03:53
-
-
Save schrum2/254dec555ba6908c8f8a21f3141e023c to your computer and use it in GitHub Desktop.
DL4J fatal exception
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static void main(String[] args) throws IOException { | |
ZooModel zooModel = new VGG16(); | |
ComputationGraph vgg16 = (ComputationGraph) zooModel.initPretrained(PretrainedType.IMAGENET); | |
NativeImageLoader loader = new NativeImageLoader(224, 224, 3); | |
DataNormalization scaler = new VGG16ImagePreProcessor(); | |
String contentFile = "data/cat.jpg"; | |
INDArray content = loader.asMatrix(new File(contentFile)); | |
scaler.transform(content); | |
// Input presentation: necessary? | |
INDArray[] result = vgg16.output(content); | |
Layer block1_conv2 = vgg16.getLayer("block1_conv2"); | |
INDArray block1_conv2_features = block1_conv2.activate(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment