File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1- import torch
21import torch .nn as nn
3- import torch .nn .functional as F
42
53class SmallCNN (nn .Module ):
64 def __init__ (self ):
@@ -17,8 +15,4 @@ def __init__(self):
1715 )
1816
1917 def forward (self , x ):
20- return self .layers (x )
21-
22- # NOTES
23- # Must use nn.Flatten instead of x.view()
24- # Must use pool1 and pool2 rather than one pool.
18+ return self .layers (x )
Original file line number Diff line number Diff line change 1010model = torch .load ("./cat_breeds/models/pretest.pt" )
1111model .chai_dump ("./cat_breeds/models/chai_model" , "SmallCNN" )
1212
13- # load_path = "./cat_breeds/data/catbreeds/images"
14- # for i, item in enumerate(os.listdir(load_path)):
15- # if "item" in item: # check file name
16- # img = np.load(f"{load_path}/{item}")
17- # img = torch.Tensor(img)
18- # img.chai_save("./cat_breeds/data/catbreeds/chai_images", f"item{i}", verbose=False)
19- # if i > 20:
20- # break
13+ load_path = "./cat_breeds/data/catbreeds/images"
14+ for i , item in enumerate (os .listdir (load_path )):
15+ if "item" in item : # check file name
16+ img = np .load (f"{ load_path } /{ item } " )
17+ img = torch .Tensor (img )
18+ img .chai_save ("./cat_breeds/data/catbreeds/chai_images" , f"item{ i } " , verbose = False )
19+ if i > 20 :
20+ break
You can’t perform that action at this time.
0 commit comments