Giter VIP home page Giter VIP logo

Comments (13)

junyanz avatar junyanz commented on July 19, 2024

Would it be possible to share with me more details? Are you using the latest code? What are your PyTorch and python version? I ran the following code and haven't been able to reproduce this error.

bash ./datasets/download_testset.sh edges2shoes
bash ./pretrained_models/download_model.sh edges2shoes
bash ./scripts/test_edges2shoes.sh
bash ./scripts/train_edges2shoes.sh

from bicyclegan.

JuHyung-Son avatar JuHyung-Son commented on July 19, 2024

i'm using python 3.7 and pytorch 1.0.0, i have same error with him

from bicyclegan.

junyanz avatar junyanz commented on July 19, 2024

Did you run the following commands?

bash ./datasets/download_testset.sh edges2shoes
bash ./pretrained_models/download_model.sh edges2shoes
bash ./scripts/test_edges2shoes.sh
bash ./scripts/train_edges2shoes.sh

from bicyclegan.

JuHyung-Son avatar JuHyung-Son commented on July 19, 2024

Yes I've tried it in pix2pix repo docker. but i have same problem.

from bicyclegan.

JuHyung-Son avatar JuHyung-Son commented on July 19, 2024

This is full error message

Loading model bicycle_gan
Traceback (most recent call last):
  File "./test.py", line 32, in <module>
    for i, data in enumerate(islice(dataset, opt.num_test)):
  File "/root/gans/BicycleGAN/data/__init__.py", line 90, in __iter__
    for i, data in enumerate(self.dataloader):
  File "/usr/local/lib/python3.5/dist-packages/torch/utils/data/dataloader.py", line 637, in __next__
    return self._process_next_batch(batch)
  File "/usr/local/lib/python3.5/dist-packages/torch/utils/data/dataloader.py", line 658, in _process_next_batch
    raise batch.exc_type(batch.exc_msg)
RuntimeError: Traceback (most recent call last):
  File "/usr/local/lib/python3.5/dist-packages/torch/utils/data/dataloader.py", line 138, in _worker_loop
    samples = collate_fn([dataset[i] for i in batch_indices])
  File "/usr/local/lib/python3.5/dist-packages/torch/utils/data/dataloader.py", line 138, in <listcomp>
    samples = collate_fn([dataset[i] for i in batch_indices])
  File "/root/gans/BicycleGAN/data/aligned_dataset.py", line 53, in __getitem__
    A = A_transform(A)
  File "/usr/local/lib/python3.5/dist-packages/torchvision/transforms/transforms.py", line 60, in __call__
    img = t(img)
  File "/usr/local/lib/python3.5/dist-packages/torchvision/transforms/transforms.py", line 163, in __call__
    return F.normalize(tensor, self.mean, self.std, self.inplace)
  File "/usr/local/lib/python3.5/dist-packages/torchvision/transforms/functional.py", line 208, in normalize
    tensor.sub_(mean[:, None, None]).div_(std[:, None, None])
RuntimeError: output with shape [1, 256, 256] doesn't match the broadcast shape [3, 256, 256]

from bicyclegan.

shazhongcheng avatar shazhongcheng commented on July 19, 2024

你运行以下命令了吗?

bash ./datasets/download_testset.sh edges2shoes
bash ./pretrained_models/download_model.sh edges2shoes
bash ./scripts/test_edges2shoes.sh
bash ./scripts/train_edges2shoes.sh

Hello! I am so thanks for your replay.
I known you run this program in linux.
But i run it in windows and use following prams from your sh scripts:

--display_id
1
--dataroot
D:\dataset\edges2shoes\edges2shoes
--name
edges2shoes_bicycle_gan
--model
bicycle_gan
--direction
AtoB
--checkpoints_dir
../checkpoints/edges2shoes/
--load_size
256
--crop_size
256
--nz
8
--input_nc
1
--niter
30
--niter_decay
30
--use_dropout

you know this is the same as you scripts:

set -ex
# models
RESULTS_DIR='./results/edges2shoes'
G_PATH='./pretrained_models/edges2shoes_net_G.pth'
E_PATH='./pretrained_models/edges2shoes_net_E.pth'

# dataset
CLASS='edges2shoes'
DIRECTION='AtoB' # from domain A to domain B
LOAD_SIZE=256 # scale images to this size
CROP_SIZE=256 # then crop to this size
INPUT_NC=1  # number of channels in the input image

# misc
GPU_ID=0   # gpu id
NUM_TEST=10 # number of input images duirng test
NUM_SAMPLES=10 # number of samples per input images

# command
CUDA_VISIBLE_DEVICES=${GPU_ID} python ./test.py \
  --dataroot ./datasets/${CLASS} \
  --results_dir ${RESULTS_DIR} \
  --checkpoints_dir ./pretrained_models/ \
  --name ${CLASS} \
  --direction ${DIRECTION} \
  --load_size ${LOAD_SIZE} \
  --crop_size ${CROP_SIZE} \
  --input_nc ${INPUT_NC} \
  --num_test ${NUM_TEST} \
  --n_samples ${NUM_SAMPLES} \
  --center_crop \
  --no_flip

from bicyclegan.

wanwgplus avatar wanwgplus commented on July 19, 2024

Pytorch 0.4 and torchvision 0.2.1 work well for testing.

from bicyclegan.

junyanz avatar junyanz commented on July 19, 2024

@shazhongcheng We don't have a Windows machine. Not sure if it is related to Windows or not.
We are still looking at this issue. It's difficult for me to reproduce with my environment. Will get back to your folks if we have a better understanding.

from bicyclegan.

Shravankp avatar Shravankp commented on July 19, 2024

error

from bicyclegan.

junyanz avatar junyanz commented on July 19, 2024

From this post, it seems to be related to the version of torchvision. Could you try to upgrade your torchvision to torchvision 0.2.1?

from bicyclegan.

junyanz avatar junyanz commented on July 19, 2024

Hi folks, could you try the latest commit? Hopefully, it can address your issues.

from bicyclegan.

shazhongcheng avatar shazhongcheng commented on July 19, 2024

torch 1.0.1
torchfile 0.1.0
torchfusion 0.3.3
torchtext 0.3.1
torchvision 0.2.2.post3
tornado 5.1.1

this is my version

and i will try latest commit . thank you for your work.

from bicyclegan.

Shravankp avatar Shravankp commented on July 19, 2024

@junyanz Yes now its working great!! Thank you.

from bicyclegan.

Related Issues (20)

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.