Giter Site home page Giter Site logo

zero_to_gans's Introduction

Zero to GANs Course Project

Status: WORK IN PROGRSS

{:toc max_level=3 }.

Links

Selected Dataset:

  • intel image classification

First steps try to get parameter for normalization. The result was terrible in ever batch there were some completely black ans some completely white images.

The Project.

I choose the intel-image-classification data set I found on Kaggle. The goal of the project is to set up an resnet similar to the on we used in the course.

The dataset contains anotated images. The goal is to train an convolutional network based on this data.

First steps

  • use the course project 05b-cifar10-resnet as starter.
  • add the dataset to the kaggle notebook.

Lessons learned so far

perpare the data

Not all Images in the dataset have the same dimensions. This must be fixed before training.

...
history = [evaluate(model, valid_dl)]

The call of evaluate results in

--------------------------------------------------------------------------
RuntimeError                              Traceback (most recent call last)
<ipython-input-19-1c4791c5f87e> in <module>
----> 1 history = [evaluate(model, valid_dl)]
      2 history

/opt/conda/lib/python3.7/site-packages/torch/autograd/grad_mode.py in decorate_context(*args, **kwargs)
     13         def decorate_context(*args, **kwargs):
     14             with self:
---> 15                 return func(*args, **kwargs)
     16         return decorate_context
     17 

...

RuntimeError: Caught RuntimeError in DataLoader worker process 1.
Original Traceback (most recent call last):
  File "/opt/conda/lib/python3.7/site-packages/torch/utils/data/_utils/worker.py", line 178, in _worker_loop
    data = fetcher.fetch(index)
  File "/opt/conda/lib/python3.7/site-packages/torch/utils/data/_utils/fetch.py", line 47, in fetch
    return self.collate_fn(data)
  File "/opt/conda/lib/python3.7/site-packages/torch/utils/data/_utils/collate.py", line 79, in default_collate
    return [default_collate(samples) for samples in transposed]
  File "/opt/conda/lib/python3.7/site-packages/torch/utils/data/_utils/collate.py", line 79, in <listcomp>
    return [default_collate(samples) for samples in transposed]
  File "/opt/conda/lib/python3.7/site-packages/torch/utils/data/_utils/collate.py", line 55, in default_collate
    return torch.stack(batch, 0, out=out)
RuntimeError: stack expects each tensor to be equal size, but got [3, 150, 150] at entry 0 and [3, 141, 150] at entry 241

Adding tt.Resize(150) to the Compose function did not fix the error.

stats = ((0.43531275, 0.46185786, 0.4556407), (0.26646963, 0.26392624, 0.29387024))
train_tfms = tt.Compose([tt.RandomCrop(32, padding=4, padding_mode='reflect'), 
                         tt.RandomHorizontalFlip(), 
                         tt.Resize(150),
                         tt.ToTensor(), 
                         tt.Normalize(*stats,inplace=True)])

Adding tt.Resize( (150,150) ) did. Take care: tt.Resize( (150,150) ) must be added to tran_tfmd and to valid_tmfs

get better results.

  1. tt.Normalize(*stats ...) does not improve the result significantly
  2. adding another linear layer did not have the the expected effect

zero_to_gans's People

Contributors

mschmidt3 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.