Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

About recall and precision #19

Open
Demo122 opened this issue Jul 4, 2021 · 1 comment
Open

About recall and precision #19

Demo122 opened this issue Jul 4, 2021 · 1 comment

Comments

@Demo122
Copy link

Demo122 commented Jul 4, 2021

I found that the recall rate and accuracy rate are very low during my training. Is my training not enough? is this normal?I am using my own data set
512/512 [====================] - 29s 56ms/step - epoch: 66 - iter: 2012224 - precision: 0.1374 - recall: 0.1230

@sakethreddy26
Copy link

i am trying to train the model with my own dataset. when i try to start the training each epoch is taking less an second to complete. can you help me with the training?

DEVICE is: cpu
/usr/local/lib/python3.10/dist-packages/torchvision/models/_utils.py:208: UserWarning: The parameter 'pretrained' is deprecated since 0.13 and may be removed in the future, please use 'weights' instead.
warnings.warn(
/usr/local/lib/python3.10/dist-packages/torchvision/models/_utils.py:223: UserWarning: Arguments other than a weight enum or None for 'weights' are deprecated since 0.13 and may be removed in the future. The current behavior is equivalent to passing weights=VGG19_Weights.IMAGENET1K_V1. You can also use weights=VGG19_Weights.DEFAULT to get the most up-to-date weights.
warnings.warn(msg)
/content/drive/MyDrive/Sahana/src/dataset.py:181: FutureWarning: In the future np.str will be defined as the corresponding NumPy scalar.
return np.genfromtxt(flist, dtype=np.str, encoding='utf-8')
Loading EdgeModel generator weights file: /content/drive/MyDrive/Sahana/model/getchu/EdgeModel_gen_2109000.pth...
/content/drive/MyDrive/Sahana/src/models.py:29: FutureWarning: You are using torch.load with weights_only=False (the current default value), which uses the default pickle module implicitly. It is possible to construct malicious pickle data which will execute arbitrary code during unpickling (See https://github.com/pytorch/pytorch/blob/main/SECURITY.md#untrusted-models for more details). In a future release, the default value for weights_only will be flipped to True. This limits the functions that could be executed during unpickling. Arbitrary objects will no longer be allowed to be loaded via this mode unless they are explicitly allowlisted by the user via torch.serialization.add_safe_globals. We recommend you start setting weights_only=True for any use case where you don't have full control of the loaded file. Please open an issue on GitHub for any issues related to this experimental feature.
data = torch.load(gen_path, map_location=lambda storage, loc: storage)
Loading EdgeModel discriminator weights file: /content/drive/MyDrive/Sahana/model/getchu/EdgeModel_dis_2109000.pth...
/content/drive/MyDrive/Sahana/src/models.py:39: FutureWarning: You are using torch.load with weights_only=False (the current default value), which uses the default pickle module implicitly. It is possible to construct malicious pickle data which will execute arbitrary code during unpickling (See https://github.com/pytorch/pytorch/blob/main/SECURITY.md#untrusted-models for more details). In a future release, the default value for weights_only will be flipped to True. This limits the functions that could be executed during unpickling. Arbitrary objects will no longer be allowed to be loaded via this mode unless they are explicitly allowlisted by the user via torch.serialization.add_safe_globals. We recommend you start setting weights_only=True for any use case where you don't have full control of the loaded file. Please open an issue on GitHub for any issues related to this experimental feature.
data = torch.load(dis_path, map_location=lambda storage, loc: storage)
Model configurations:

MODE: 1 # 1: train, 2: test, 3: eval
MODEL: 1 # 1: edge model, 2: inpaint model, 3: edge-inpaint model, 4: joint model
MASK: 3 # 1: random block, 2: half, 3: external, 4: (external, random block), 5: (external, random block, half)
EDGE: 1 # 1: canny, 2: external
NMS: 1 # 0: no non-max-suppression, 1: applies non-max-suppression on the external edges by multiplying by Canny
SEED: 10 # random seed
DEVICE: 0 # 0: CPU, 1: GPU
GPU: [0] # list of gpu ids
DEBUG: 1 # turns on debugging mode
VERBOSE: 0 # turns on verbose mode in the output console
SKIP_PHASE2: 1 # When training Inpaint model, 2nd and 3rd phases (model 2--->model 3 ) by order are needed. But we can merge 2nd phase into the 3rd one to speed up (however, lower performance).

TRAIN_FLIST: /content/drive/MyDrive/Sahana/Datasets/output_image_lists/train.flist
VAL_FLIST: /content/drive/MyDrive/Sahana/Datasets/output_image_lists/val.flist
TEST_FLIST: /content/drive/MyDrive/Sahana/Datasets/output_image_lists/test.flist

TRAIN_EDGE_FLIST: /content/drive/MyDrive/Sahana/Datasets/output_edge_lists/train.flist
VAL_EDGE_FLIST: /content/drive/MyDrive/Sahana/Datasets/output_edge_lists/val.flist
TEST_EDGE_FLIST: /content/drive/MyDrive/Sahana/Datasets/output_edge_lists/test.flist

TRAIN_MASK_FLIST: /content/drive/MyDrive/Sahana/Datasets/output_mask_lists/train.flist
VAL_MASK_FLIST: /content/drive/MyDrive/Sahana/Datasets/output_mask_lists/val.flist
TEST_MASK_FLIST: /content/drive/MyDrive/Sahana/Datasets/output_mask_lists/test.flist

LR: 0.0001 # learning rate
D2G_LR: 0.1 # discriminator/generator learning rate ratio
BETA1: 0.0 # adam optimizer beta1
BETA2: 0.9 # adam optimizer beta2
BATCH_SIZE: 8 # input batch size for training
INPUT_SIZE: 128 # input image size for training 0 for original size
SIGMA: 1.5 # standard deviation of the Gaussian filter used in Canny edge detector (0: random, -1: no edge)
MAX_ITERS: 2e7 # maximum number of iterations to train the model

EDGE_THRESHOLD: 0.5 # edge detection threshold
L1_LOSS_WEIGHT: 1 # l1 loss weight
FM_LOSS_WEIGHT: 10 # feature-matching loss weight
STYLE_LOSS_WEIGHT: 1 # style loss weight
CONTENT_LOSS_WEIGHT: 1 # perceptual loss weight
INPAINT_ADV_LOSS_WEIGHT: 0.01 # adversarial loss weight

GAN_LOSS: nsgan # nsgan | lsgan | hinge
GAN_POOL_SIZE: 0 # fake images pool size

SAVE_INTERVAL: 30 # how many iterations to wait before saving model (0: never)
SAMPLE_INTERVAL: 200 # how many iterations to wait before sampling (0: never)
SAMPLE_SIZE: 12 # number of images to sample
EVAL_INTERVAL: 0 # how many iterations to wait before model evaluation (0: never)
LOG_INTERVAL: 1000 # how many iterations to wait before logging training status (0: never)
PRINT_INTERVAL: 20 # how many iterations to wait before terminal prints training status (0: never)
PRETRAINED_PATH: '/content/drive/MyDrive/Sahana/model/getchu'

start training...

/usr/local/lib/python3.10/dist-packages/torch/utils/data/dataloader.py:557: UserWarning: This DataLoader will create 4 worker processes in total. Our suggested max number of worker in current system is 2, which is smaller than what this DataLoader is going to create. Please be aware that excessive worker creation might get DataLoader running slow or even freeze, lower the worker number to avoid potential slowness/freeze if necessary.
warnings.warn(_create_warning_msg(

Training epoch: 1
Training epoch: 2
Training epoch: 3
Training epoch: 4
Training epoch: 5
Training epoch: 6
Training epoch: 7

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants