deepjavalibrary / deepjavalibrary/djl

Is it possible to train a PyTorch SSD model on an M1 Mac - or is this not yet implemented? PtNDArrayEx.multiBoxPrior(PtNDArrayEx.java:697) UnsupportedOperationException: Not implemented

Open
#2,693 6 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
Java
Stars
4.9k
Forks
759
Avg merge
16h 15m
Merged PRs (30d)
15

Description

## Description
When running `TrainPikachuTest` on an M1 Mac I get the error `UnsupportedOperationException: Not implemented`

### Expected Behavior
The `TrainPikachuTest` runs as expected and a model is produced.

### Error Message
```
Exception in thread "main" java.lang.UnsupportedOperationException: Not implemented
at ai.djl.pytorch.engine.PtNDArrayEx.multiBoxPrior(PtNDArrayEx.java:697)
at ai.djl.modality.cv.MultiBoxPrior.generateAnchorBoxes(MultiBoxPrior.java:68)
at ai.djl.basicmodelzoo.cv.object_detection.ssd.SingleShotDetection.forwardInternal(SingleShotDetection.java:84)
at ai.djl.nn.AbstractBaseBlock.forwardInternal(AbstractBaseBlock.java:128)
at ai.djl.nn.AbstractBaseBlock.forward(AbstractBaseBlock.java:93)
at ai.djl.training.Trainer.forward(Trainer.java:189)
at ai.djl.training.EasyTrain.trainSplit(EasyTrain.java:122)
at ai.djl.training.EasyTrain.trainBatch(EasyTrain.java:110)
at ai.djl.training.EasyTrain.fit(EasyTrain.java:58)
at ai.djl.examples.training.TrainPikachu.runExample(TrainPikachu.java:93)
at ai.djl.examples.training.TrainPikachuTest.testDetection(TrainPikachuTest.java:52)
at ai.djl.examples.training.TrainPikachuTest.main(TrainPikachuTest.java:30)
```

## How to Reproduce?
Run the class `TrainPikachuTest` on an M1 Mac

### Steps to reproduce
(Paste the commands you ran that produced the error.)
1. Run the `TrainPikachuTest` class with `DJL_DEFAULT_ENGINE=PyTorch`

## What have you tried to solve it?

1. Debugging through the code - and looking at the implementation of the class.
2. Looking for other examples of training doing SingleShotDetection. (Didn't find any).

## Environment Info

```
DJL_DEFAULT_ENGINE=PyTorch
JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk-11.jdk/Contents/Home
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.