Coder Social home page Coder Social logo

duskvirkus / alias-free-gan Goto Github PK

View Code? Open in Web Editor NEW
77.0 7.0 15.0 122.04 MB

Unofficial Alias-Free GAN implementation. Based on rosinality's version with expanded training and inference options.

License: MIT License

Python 61.63% Jupyter Notebook 33.80% C++ 0.61% Cuda 3.87% Shell 0.09%
alias-free-gan pytorch pytorch-lightning machine-learning mlart ai-art generative-art stylegan

alias-free-gan's Introduction

Make art not autonomous weapons systems.

alias-free-gan's People

Contributors

duskvirkus avatar pabloppp avatar rosinality 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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

alias-free-gan's Issues

Trainer.py error

Hi, first of all many thanks for the repo.
I'm trying to run in Colab:

!python /content/drive/MyDrive/colab-alias-free-gan/alias-free-gan/scripts/trainer.py --help

and I'm getting this error:

/usr/local/lib/python3.7/dist-packages/pytorch_lightning/core/decorators.py:17: LightningDeprecationWarning: Using pytorch_lightning.core.decorators.parameter_validation is deprecated in v1.5, and will be removed in v1.7. It has been replaced by automatic parameters tying with pytorch_lightning.utilities.params_tying.set_shared_parameters
"Using pytorch_lightning.core.decorators.parameter_validation is deprecated in v1.5, "
Traceback (most recent call last):
File "/content/drive/MyDrive/colab-alias-free-gan/alias-free-gan/scripts/trainer.py", line 19, in
from src.alias_free_gan import AliasFreeGAN
File "/content/drive/MyDrive/colab-alias-free-gan/alias-free-gan/scripts/../src/alias_free_gan.py", line 18, in
from src.model import Generator, filter_parameters
File "/content/drive/MyDrive/colab-alias-free-gan/alias-free-gan/scripts/../src/model.py", line 11, in
from src.stylegan2.model import PixelNorm, EqualLinear, EqualConv2d
File "/content/drive/MyDrive/colab-alias-free-gan/alias-free-gan/scripts/../src/stylegan2/model.py", line 18, in
from pytorch_lightning.core.decorators import auto_move_data
ImportError: cannot import name 'auto_move_data' from 'pytorch_lightning.core.decorators' (/usr/local/lib/python3.7/dist-packages/pytorch_lightning/core/decorators.py)

Is it a bug? any hint?
many thanks in advance :)

DataLoader memory problem

Occurred when training on V100 colab session. Likely standard memory config.

Low priority bug but still worth noting.

Epoch 17:  81% 6080/7499 [54:22<12:41,  1.86it/s, kimgs=1627.126, r_t_stat=0.750, ada_aug_p=0.484256]ERROR: Unexpected bus error encountered in worker. This might be caused by insufficient shared memory (shm).
�Traceback (most recent call last):
  File "scripts/trainer.py", line 178, in <module>
  File "scripts/trainer.py", line 175, in cli_main
  File "/usr/local/lib/python3.7/dist-packages/pytorch_lightning/trainer/trainer.py", line 553, in fit
    self._run(model)
  File "/usr/local/lib/python3.7/dist-packages/pytorch_lightning/trainer/trainer.py", line 918, in _run
    self._dispatch()
  File "/usr/local/lib/python3.7/dist-packages/pytorch_lightning/trainer/trainer.py", line 986, in _dispatch
    self.accelerator.start_training(self)
  File "/usr/local/lib/python3.7/dist-packages/pytorch_lightning/accelerators/accelerator.py", line 92, in start_training
    self.training_type_plugin.start_training(trainer)
  File "/usr/local/lib/python3.7/dist-packages/pytorch_lightning/plugins/training_type/training_type_plugin.py", line 161, in start_training
    self._results = trainer.run_stage()
  File "/usr/local/lib/python3.7/dist-packages/pytorch_lightning/trainer/trainer.py", line 996, in run_stage
    return self._run_train()
  File "/usr/local/lib/python3.7/dist-packages/pytorch_lightning/trainer/trainer.py", line 1045, in _run_train
    self.fit_loop.run()
  File "/usr/local/lib/python3.7/dist-packages/pytorch_lightning/loops/base.py", line 111, in run
    self.advance(*args, **kwargs)
  File "/usr/local/lib/python3.7/dist-packages/pytorch_lightning/loops/fit_loop.py", line 200, in advance
    epoch_output = self.epoch_loop.run(train_dataloader)
  File "/usr/local/lib/python3.7/dist-packages/pytorch_lightning/loops/base.py", line 111, in run
    self.advance(*args, **kwargs)
  File "/usr/local/lib/python3.7/dist-packages/pytorch_lightning/loops/epoch/training_epoch_loop.py", line 130, in advance
    batch_output = self.batch_loop.run(batch, self.iteration_count, self._dataloader_idx)
  File "/usr/local/lib/python3.7/dist-packages/pytorch_lightning/loops/batch/training_batch_loop.py", line 101, in run
    super().run(batch, batch_idx, dataloader_idx)
  File "/usr/local/lib/python3.7/dist-packages/pytorch_lightning/loops/base.py", line 111, in run
    self.advance(*args, **kwargs)
  File "/usr/local/lib/python3.7/dist-packages/pytorch_lightning/loops/batch/training_batch_loop.py", line 148, in advance
    result = self._run_optimization(batch_idx, split_batch, opt_idx, optimizer)
  File "/usr/local/lib/python3.7/dist-packages/pytorch_lightning/loops/batch/training_batch_loop.py", line 209, in _run_optimization
    self._update_running_loss(result.loss)
  File "/usr/local/lib/python3.7/dist-packages/pytorch_lightning/loops/batch/training_batch_loop.py", line 603, in _update_running_loss
    self.accumulated_loss.append(current_loss)
  File "/usr/local/lib/python3.7/dist-packages/pytorch_lightning/trainer/supporters.py", line 82, in append
    x = x.to(self.memory)
  File "/usr/local/lib/python3.7/dist-packages/torch/utils/data/_utils/signal_handling.py", line 66, in handler
    _error_if_any_worker_fails()
RuntimeError: DataLoader worker (pid 873) is killed by signal: Bus error. It is possible that dataloader's workers are out of shared memory. Please try to raise your shared memory limit.
Epoch 17:  81%|████████  | 6080/7499 [54:31<12:43,  1.86it/s, kimgs=1627.126, r_t_stat=0.750, ada_aug_p=0.484256]

ModuleNotFoundError: No module named 'torchtext.legacy'

Hi,

When resuming training from checkpoint, the following error raises:
ModuleNotFoundError: No module named 'torchtext.legacy'
Tried to install an older release of torchtext, but then this error pops up:
ImportError: cannot import name 'QuantStub' from 'torch.ao.quantization'

any clue how to solve this?

Curious about CI costs

I've been thinking about adding CI to clip-guided-diffusion - I have a few integration tests that just run a few forward passes on CPU/GPU. Saw your note about pricing being an issue and it's essentially the main thing preventing me from doing that on a GPU setup in the cloud. For now, I'm fortunate the most of the checkpoints run inference fine on my RTX 2070 that I own.

Assuming you don't have any issue with revealing such info; what are the costs like for CI on the project? Do you have any tips for people trying to do CI with machine learning?

Thanks in advance for any info

TPU issues in Colab

I'd like to thank you in advance for the work you're doing.

I tried the code with TPU and ran into two problems that may be related. Both errors only occur with the TPU instance, the GPU instances are OK. And it is not a priority for me, I just wanted to report what I found.

1) python install.py prints the following error at the end:

ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behavior is the source of the following dependency conflicts.
earthengine-api 0.1.278 requires google-api-python-client<2,>=1.12.1, but you have google-api-python-client 1.8.0 which is incompatible. Successfully installed cloud-tpu-client-0.10 google-api-python-client-1.8.0 torch-xla-1.9.1

2) trainer.py ends with the following error even if I just run python scripts/trainer.py --help

Traceback (most recent call last):
  File "scripts/trainer.py", line 10, in <module>
    import pytorch_lightning as pl
  File "/usr/local/lib/python3.7/dist-packages/pytorch_lightning/__init__.py", line 20, in <module>
    from pytorch_lightning import metrics  # noqa: E402
  File "/usr/local/lib/python3.7/dist-packages/pytorch_lightning/metrics/__init__.py", line 15, in <module>
    from pytorch_lightning.metrics.classification import (  # noqa: F401
  File "/usr/local/lib/python3.7/dist-packages/pytorch_lightning/metrics/classification/__init__.py", line 14, in <module>
    from pytorch_lightning.metrics.classification.accuracy import Accuracy  # noqa: F401
  File "/usr/local/lib/python3.7/dist-packages/pytorch_lightning/metrics/classification/accuracy.py", line 18, in <module>
    from pytorch_lightning.metrics.utils import deprecated_metrics, void
  File "/usr/local/lib/python3.7/dist-packages/pytorch_lightning/metrics/utils.py", line 29, in <module>
    from pytorch_lightning.utilities import rank_zero_deprecation
  File "/usr/local/lib/python3.7/dist-packages/pytorch_lightning/utilities/__init__.py", line 18, in <module>
    from pytorch_lightning.utilities.apply_func import move_data_to_device  # noqa: F401
  File "/usr/local/lib/python3.7/dist-packages/pytorch_lightning/utilities/apply_func.py", line 27, in <module>
    from pytorch_lightning.utilities.imports import _compare_version, _TORCHTEXT_AVAILABLE
  File "/usr/local/lib/python3.7/dist-packages/pytorch_lightning/utilities/imports.py", line 93, in <module>
    from pytorch_lightning.utilities.xla_device import XLADeviceUtils  # noqa: E402
  File "/usr/local/lib/python3.7/dist-packages/pytorch_lightning/utilities/xla_device.py", line 23, in <module>
    import torch_xla.core.xla_model as xm
  File "/usr/local/lib/python3.7/dist-packages/torch_xla/__init__.py", line 101, in <module>
    import _XLAC
ImportError: /usr/local/lib/python3.7/dist-packages/_XLAC.cpython-37m-x86_64-linux-gnu.so: undefined symbol: _ZNK2at10TensorBase8data_ptrIN3c107complexIfEEEEPT_v

Missing .pt file

Hi. If I follow all your cells and instructions in order, I get this once I reach the second cell of "Generate Single Images"

Using Alias-Free GAN version: 1.0.0
Invalid path /content/drive/MyDrive/colab-gpu-alias-free/alias-free-gan/results/training-000005/000145-epoch-checkpoint.pt is not a .pt model file.

I cannot find that file anywhere or any other .pt file for that matter.

Thanks.

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.