suetandtie / cycle-image-gan Goto Github PK
View Code? Open in Web Editor NEWLicense: MIT License
License: MIT License
Hi,
when running with the command python main.py --cfg cfg/bird_cycle.yaml --gpu 0
the function crashes on PIL_att = Image.fromarray(np.uint8(one_map))
.
This is the error:
File "/Data/anaconda3/envs/cyclegan-py3/lib/python3.6/site-packages/PIL/Image.py", line 2772, in fromarray
mode, rawmode = _fromarray_typemap[typekey]
KeyError: ((1, 1, 6), '|u1')
I guess is a problem of dimensions, one_map ha dimension (128, 128, 6) while img has (128, 128, 3).
Any ideas how to solve it?
Thanks
super(_open_file, self).__init__(open(name, mode))
FileNotFoundError: [Errno 2] No such file or directory: 'output/birds_STREAM_2019_06_07_18_55_55/Model/image_encoder100.pth'
Hi,
Your YAML file refer to pth file which I assume is the trained model. Where do we get that?
attn = attn_maps[i].cpu().view(1, -1, att_sze, att_sze)
IndexError: index 2 is out of bounds for dimension 0 with size 2
Please help how can I resolve this issue?
how to solve
“Model name 'bert-base-uncased' was not found in model name list (bert-base-uncased, bert-large-uncased, bert-base-cased, bert-large-cased, bert-base-multilingual-uncased, bert-base-multilingual-cased, bert-base-chinese). We assumed 'https://s3.amazonaws.com/models.huggingface.co/bert/bert-base-uncased-vocab.txt' was a path or url but couldn't find any file associated to this path or url.”
cycle-image-gan/miscc/utils.py
Line 131 in de61bef
Hi guys,
I think depending on your version of scikit-image the function pyramid_expand
might require the flag multichannel
Hence:
one_map = \
skimage.transform.pyramid_expand(one_map, sigma=20,
upscale=vis_size // att_sze)
Should become:
one_map = \
skimage.transform.pyramid_expand(one_map, sigma=20,
upscale=vis_size // att_sze,
multichannel=True)
Hope this can be of some help to anyone that encounter an issue related to expanding all the channels.
Best wishes,
I was having the problem of training 11788 images in google colab (I had GPU limitations). So I decided to run the same code using 10 species instead of 200 which resulted in 543 images after making necessary changes in datasets.
After running the pretrain STREAM.py, I got image encoder.pth and text encoder.pth.
Then the problem occured after running the second command, "python main.py --cfg cfg/bird_cycle.yaml --gpu 0"
Traceback (most recent call last):
File "/content/drive/MyDrive/BPI_V2 - Copy/cycle-image-gan-master/main.py", line 141, in
algo.train()
File "/content/drive/MyDrive/BPI_V2 - Copy/cycle-image-gan-master/trainer.py", line 701, in train
errD = discriminator_loss(netsD[i], imgs[i], fake_imgs[i],
File "/content/drive/MyDrive/BPI_V2 - Copy/cycle-image-gan-master/miscc/losses.py", line 153, in discriminator_loss
cond_real_logits = netD.COND_DNET(real_features, conditions)
File "/usr/local/lib/python3.9/dist-packages/torch/nn/modules/module.py", line 1194, in _call_impl
return forward_call(*input, **kwargs)
File "/content/drive/MyDrive/BPI_V2 - Copy/cycle-image-gan-master/model.py", line 829, in forward
h_c_code = torch.cat((h_code, c_code), 1)
RuntimeError: Sizes of tensors must match except in dimension 1. Expected size 18 but got size 4 for tensor number 1 in the list.
** I printed the size of h_code and c_code
h_code.shape = torch.Size([20, 512, 18, 18])
c_code.shape = torch.Size([20, 768, 4, 4])
Hi there thanks for the great work!
When I was trying to run
python pretrain_STREAM.py --cfg cfg/STREAM/bird.yaml --gpu 0
on colab, I got this error:
TypeError: Cannot handle this data type: (1, 1, 48), |u1
I guess that might be an environmental issue, would you mind share your environment requirement for this implementation?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.