示例#1
0
def test_which_processor():
    # Naive test: Just run the function to see whether it works or does not work
    which_processor()
示例#2
0
    ClassificationInterpretation,
    to_np,
)
from fastai.metrics import accuracy
import fastai

from pathlib import Path
import numpy as np
import sys

# fastai and torch

# local modules

print(f"Fast.ai version = {fastai.__version__}")
which_processor()

EPOCHS = 10
LEARNING_RATE = 1e-4
IM_SIZE = 300

BATCH_SIZE = 16
ARCHITECTURE = models.resnet18
path = Path('/app/classifier_data/')

data = (ImageList.from_folder(path).split_by_rand_pct(
    valid_pct=0.2,
    seed=10).label_from_folder().transform(size=IM_SIZE).databunch(
        bs=BATCH_SIZE, num_workers=db_num_workers()).normalize(imagenet_stats))

print(f'number of classes: {data.c}')