Comments (5)
@nassarofficial From the readme, do the following:
"To prep your own dataset, you will need to add it to datasets.py and modify the convenience dicts in utils.py (dset_dict, imsize_dict, root_dict, nclass_dict, classes_per_sheet_dict) to have the appropriate metadata for your dataset. Repeat the process in prepare_data.sh (optionally produce an HDF5 preprocessed copy, and calculate the Inception Moments for FID)."
You can see the modifications I made for my dataset in my original post. If your images are larger than 256x256, you'll have to modify the discriminator architecture accordingly.
from biggan-pytorch.
The architecture modifications should be sufficient, but I'm guessing you're not handling the dataset properly. Make sure the outputs of the dataset itself are actually single channel first (you'll probably also need to modify the dataloader transforms in utils.py
, as those all use three-channel inputs for norm_mean and norm_std. I'm guessing that even though your PNGs are greyscale they might still be loaded by the ImageFolder
dataset as three-channel images where all three channels are the same. Make sure your data is correct first!
Regardless, if you want to use the HDF5 you'll also need to make sure the HDF5 you're producing from your dataset has only 1 channel. These lines have a 3 in the channel dim for the max_shape
and chunk
args.
You might also consider training on the non-HDF5 version of the dataset to make sure you're loading single-channel images before producing the HDF5.
from biggan-pytorch.
Thanks for the quick response.
I've made the changes to the max_shape
and chunks
arguments and changed the data loader transforms in utils.py
to norm_mean, norm_std = [0.5], [0.5].
I tried to check whether I'm actually loading single-channel images by running the non-HDF5 version by using the flag --dataset larcv_png
in the launch script. The ImageFolder
loads a numpy array of strings where each string is a full path to a training image. That is, imgs.shape: (400,2)
. The routine then fails at return transforms.functional.center_crop(img, min(img.size))
in utils.py
with the message: TypeError: 'int' object is not iterable
.
I'm apologize if I've missed something here but I am unsure of how to proceed.
from biggan-pytorch.
Update:
I changed the line:
path, target = self.transform(imgs[index][0]), imgs[index][1]
in ImageFolder
to
path, target = imgs[index][0], imgs[index][1]
. This allows the PNG data to load as PIL images.
However, this change caused an error at for n, item in enumerate(items):
in the progress
function in utils.py
. item
is expected to be a torch tensor but is a PIL image instead. I found that this problem occurred because the image transforms were not being applied inside of the __getitem__
attribute in the ImageFolder
class because this line is indented too far. I fixed the indent and the model began training.
Hope this is helpful and thank you so much for pointing me in the right direction!
from biggan-pytorch.
@kseuro how did you load your own dataset?
from biggan-pytorch.
Related Issues (20)
- Training with 96x96 input HOT 1
- 我长期研究和改进GAN,如果对GAN或者深度学习感兴趣的可以联系我,联系方式,wechat: lovedaixiaobaby
- How can I improve the quality of generated images?
- AttributeError: 'Distribution' object has no attribute 'dist_type' HOT 2
- why the inception scores and FIDs are not comparable with the TF version?
- Out of memory HOT 3
- requirements.txt or library versions
- Training with ImageNet 64x64 HOT 1
- sampling out of memory HOT 1
- Correct attention layer implementation HOT 4
- y_ and y variables in training function
- Query about orthogonal regularization implementation
- collapsed samples
- Trouble training it from scratch
- BigGAN-deep pre-trained
- How to train BigGAN for image generation conditioned on text description? HOT 1
- set cross_replica as true got bad result HOT 1
- Output 80x688 images
- Problems when sampling
- The model was trained. How to generate the images?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from biggan-pytorch.