Git Product home page Git Product logo

moemen95 / pytorch-project-template Goto Github PK

View Code? Open in Web Editor NEW
866.0 26.0 192.0 168 KB

A scalable template for PyTorch projects, with examples in Image Segmentation, Object classification, GANs and Reinforcement Learning.

Home Page: https://www.linkedin.com/pulse/pytorch-project-template-do-smart-way-hager-rady/?published=t

License: MIT License

Python 99.69% Shell 0.31%
pytorch pytorch-tutorial pytorch-template pytorch-project-template dcgan condense-net erfnet dqn deep-learning machine-learning

pytorch-project-template's People

Contributors

dependabot[bot] avatar hagerrady13 avatar jianquanwang avatar moemen95 avatar pylink88 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

pytorch-project-template's Issues

Integration with Ray Tune

Dear All,

I am currently using this very useful template and I was wondering if you have ever used it with Ray Tune for hyperparameter fine-tuning. Thank you!

Absolute Import Error

Downloaded the repository as it is and tried running the agents\mnist.py, but it gives an error
Module Not Found: No module named graphs

There seems to be a problem with this type of absolute import, currently using a windows system.

DCGAN: Using a target size that is different to the input size is deprecated

Hi, and thanks for the great PyTorch template!

When I try to run the DCGAN, I get the following error. Do you see what's incorrect?

THE Configuration of your experiment ..
{'agent': 'DCGANAgent',
'async_loading': True,
'batch_size': 64,
'beta1': 0.5,
'beta2': 0.999,
'checkpoint_file': 'checkpoint.pth.tar',
'cuda': True,
'data_folder': './data/celeba',
'data_loader': 'CelebADataLoader',
'data_loader_workers': 2,
'data_mode': 'imgs',
'exp_name': 'dcgan_exp_0',
'g_input_size': 100,
'gpu_device': 0,
'image_size': 64,
'input_channels': 3,
'learning_rate': 0.0002,
'max_epoch': 1,
'mode': 'train',
'num_classes': 2,
'num_filt_d': 64,
'num_filt_g': 64,
'pin_memory': True,
'relu_slope': 0.2,
'seed': 12345,
'validate_every': 2,
'weight_decay': 0,
'x_test': '',
'x_train': '',
'x_valid': '',
'y_test': '',
'y_train': '',
'y_valid': ''}
*************************************** 
The experiment name is dcgan_exp_0
*************************************** 
[INFO]: Hi, This is root.
[INFO]: After the configurations are successfully processed and dirs are created.
[INFO]: The pipeline of the project will begin now.
--- Logging error ---
Traceback (most recent call last):
 File "/home/$USER/anaconda3/envs/torch/lib/python3.6/logging/__init__.py", line 993, in emit
   msg = self.format(record)
 File "/home/$USER/anaconda3/envs/torch/lib/python3.6/logging/__init__.py", line 839, in format
   return fmt.format(record)
 File "/home/$USER/anaconda3/envs/torch/lib/python3.6/logging/__init__.py", line 576, in format
   record.message = record.getMessage()
 File "/home/$USER/anaconda3/envs/torch/lib/python3.6/logging/__init__.py", line 338, in getMessage
   msg = msg % self.args
TypeError: not all arguments converted during string formatting
Call stack:
 File "main.py", line 38, in <module>
   main()
 File "main.py", line 32, in main
   agent = agent_class(config)
 File "/home/$USER/pytorch/agents/dcgan.py", line 65, in __init__
   self.logger.info ("seed: " , self.manual_seed)
Message: 'seed: '
Arguments: (3744,)
--- Logging error ---
Traceback (most recent call last):
 File "/home/$USER/anaconda3/envs/torch/lib/python3.6/logging/handlers.py", line 71, in emit
   if self.shouldRollover(record):
 File "/home/$USER/anaconda3/envs/torch/lib/python3.6/logging/handlers.py", line 187, in shouldRollover
   msg = "%s\n" % self.format(record)
 File "/home/$USER/anaconda3/envs/torch/lib/python3.6/logging/__init__.py", line 839, in format
   return fmt.format(record)
 File "/home/$USER/anaconda3/envs/torch/lib/python3.6/logging/__init__.py", line 576, in format
   record.message = record.getMessage()
 File "/home/$USER/anaconda3/envs/torch/lib/python3.6/logging/__init__.py", line 338, in getMessage
   msg = msg % self.args
TypeError: not all arguments converted during string formatting
Call stack:
 File "main.py", line 38, in <module>
   main()
 File "main.py", line 32, in main
   agent = agent_class(config)
 File "/home/$USER/pytorch/agents/dcgan.py", line 65, in __init__
   self.logger.info ("seed: " , self.manual_seed)
Message: 'seed: '
Arguments: (3744,)
[INFO]: Program will run on *****CPU***** 
[INFO]: Loading checkpoint 'experiments/dcgan_exp_0/checkpoints/checkpoint.pth.tar'
[INFO]: No checkpoint exists from 'experiments/dcgan_exp_0/checkpoints/'. Skipping...
[INFO]: **First time to train**
epoch-0-:   0%|                                                                 | 0/3166 [00:00<?, ?it/s]/home/$USER/anaconda3/envs/torch/lib/python3.6/site-packages/torch/nn/functional.py:1594: UserWarning: Using a target size (torch.Size([64])) that is different to the input size (torch.Size([5120])) is deprecated. Please ensure they have the same size.
 "Please ensure they have the same size.".format(target.size(), input.size()))
Exception ignored in: <bound method _DataLoaderIter.__del__ of <torch.utils.data.dataloader._DataLoaderIter object at 0x7f13e317d710>>
Traceback (most recent call last):
 File "/home/$USER/anaconda3/envs/torch/lib/python3.6/site-packages/torch/utils/data/dataloader.py", line 399, in __del__
   self._shutdown_workers()
 File "/home/$USER/anaconda3/envs/torch/lib/python3.6/site-packages/torch/utils/data/dataloader.py", line 378, in _shutdown_workers
   self.worker_result_queue.get()
 File "/home/$USER/anaconda3/envs/torch/lib/python3.6/multiprocessing/queues.py", line 337, in get
   return _ForkingPickler.loads(res)
 File "/home/$USER/anaconda3/envs/torch/lib/python3.6/site-packages/torch/multiprocessing/reductions.py", line 151, in rebuild_storage_fd
   fd = df.detach()
 File "/home/$USER/anaconda3/envs/torch/lib/python3.6/multiprocessing/resource_sharer.py", line 57, in detach
   with _resource_sharer.get_connection(self._id) as conn:
 File "/home/$USER/anaconda3/envs/torch/lib/python3.6/multiprocessing/resource_sharer.py", line 87, in get_connection
   c = Client(address, authkey=process.current_process().authkey)
 File "/home/$USER/anaconda3/envs/torch/lib/python3.6/multiprocessing/connection.py", line 493, in Client
   answer_challenge(c, authkey)
 File "/home/$USER/anaconda3/envs/torch/lib/python3.6/multiprocessing/connection.py", line 737, in answer_challenge
   response = connection.recv_bytes(256)        # reject large message
 File "/home/$USER/anaconda3/envs/torch/lib/python3.6/multiprocessing/connection.py", line 216, in recv_bytes
   buf = self._recv_bytes(maxlength)
 File "/home/$USER/anaconda3/envs/torch/lib/python3.6/multiprocessing/connection.py", line 407, in _recv_bytes
   buf = self._recv(4)
 File "/home/$USER/anaconda3/envs/torch/lib/python3.6/multiprocessing/connection.py", line 379, in _recv
   chunk = read(handle, remaining)
ConnectionResetError: [Errno 104] Connection reset by peer
Traceback (most recent call last):
 File "main.py", line 38, in <module>
   main()
 File "main.py", line 33, in main
   agent.run()
 File "/home/$USER/pytorch/agents/dcgan.py", line 133, in run
   self.train()
 File "/home/$USER/pytorch/agents/dcgan.py", line 141, in train
   self.train_one_epoch()
 File "/home/$USER/pytorch/agents/dcgan.py", line 175, in train_one_epoch
   loss_D_real = self.loss(D_real_out, y)
 File "/home/$USER/anaconda3/envs/torch/lib/python3.6/site-packages/torch/nn/modules/module.py", line 477, in __call__
   result = self.forward(*input, **kwargs)
 File "/home/$USER/pytorch/graphs/losses/bce.py", line 15, in forward
   loss = self.loss(logits, labels)
 File "/home/$USER/anaconda3/envs/torch/lib/python3.6/site-packages/torch/nn/modules/module.py", line 477, in __call__
   result = self.forward(*input, **kwargs)
 File "/home/$USER/anaconda3/envs/torch/lib/python3.6/site-packages/torch/nn/modules/loss.py", line 486, in forward
   return F.binary_cross_entropy(input, target, weight=self.weight, reduction=self.reduction)
 File "/home/$USER/anaconda3/envs/torch/lib/python3.6/site-packages/torch/nn/functional.py", line 1597, in binary_cross_entropy
   "!= input nelement ({})".format(target.nelement(), input.nelement()))
ValueError: Target and input must have the same number of elements. target nelement (64) != input nelement (5120)

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.