File size: 565 Bytes
204d5f4
 
 
 
 
 
 
 
 
 
 
7bae0dc
204d5f4
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
---
tags:
- image-classification
library_name: generic
---

# Dog vs Cat Image Classification with FastAI CNN

Training is based in FastAI [Quick Start](https://docs.fast.ai/quick_start.html). Example training


## Training

The model was trained as follows

```python
path = untar_data(URLs.PETS)/'images'

def is_cat(x): return x[0].isupper()
dls = ImageDataLoaders.from_name_func(
    path, get_image_files(path), valid_pct=0.2, seed=42,
    label_func=is_cat, item_tfms=Resize(224))

learn = cnn_learner(dls, resnet34, metrics=error_rate)
learn.fine_tune(1)
```