GithubHelp home page GithubHelp logo

cycle-image-gan's People

Contributors

samirsen avatar suetandtie 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

Watchers

 avatar  avatar  avatar

cycle-image-gan's Issues

Error in utils.build_super_images

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

no such file

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'

IndeXError

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?

skimage.transform.pyramid_expand

skimage.transform.pyramid_expand(one_map, sigma=20,

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,

Tensor Size Mismatched

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])

About environment issue

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?

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.