apiVersion: batch/v1
kind: Job
metadata:
  name: ocr-train-ranged-7-10-m
spec:
  template:
    metadata:
      labels:
        app: ocr
    spec:
      restartPolicy: Never
      containers:
        - name: ocr
          image: registry.datexis.com/tsteffek/licenseplatereconstructor:1f9407be8045128a020b5f05fbbb5ab74705ec53
          command: [ "python" ]
          args: [ "bin/TrainOCR.py",
                  "--path", "/var/lib/images",
                  "--width_mult", "0.5",
                  "--early_stopping",
                  "--max_epochs", "300",
                  "--min_epochs", "50",
                  "--default_root_dir", "/var/lib/models/ranged-7-10",
                  "--batch_size", "3000",
                  "--lr", "6e-4",
                  "--gpus", "-1",
                  "--precision", "16",
                  "--progress_bar_refresh_ratio", "0.1",
                  "--accelerator", "ddp"
          ]
          resources:
            requests:
              nvidia.com/gpu: 2
              memory: 200Gi
            limits:
              nvidia.com/gpu: 2
              memory: 350Gi
          volumeMounts:
            - name: ocr-images
              mountPath: /var/lib/images
            - name: ocr-models
              mountPath: /var/lib/models
            - name: dshm
              mountPath: /dev/shm
      volumes:
        - name: ocr-models
          persistentVolumeClaim:
            claimName: ocr-models-pvc
        - name: ocr-images
          persistentVolumeClaim:
            claimName: ocr-images-pvc-ranged-7-10-m
        - name: dshm
          emptyDir:
            medium: Memory
      imagePullSecrets:
        - name: private-registry-auth
      nodeSelector:
        gpu: a100
