Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

paddle-gan在windows运行StarGAN V2算法报错 #866

Open
xiaoxiaotom opened this issue Nov 22, 2024 · 0 comments
Open

paddle-gan在windows运行StarGAN V2算法报错 #866

xiaoxiaotom opened this issue Nov 22, 2024 · 0 comments
Assignees

Comments

@xiaoxiaotom
Copy link

(paddlegan) PS F:\PaddleGAN> python -u tools/main.py --config-file configs/starganv2_celeba_hq.yaml
[11/21 11:29:27] ppgan INFO: Configs:
dataset:
test:
batch_size: 16
dataroot: data/stargan-v2/celeba_hq/val/
is_train: false
name: StarGANv2Dataset
num_workers: 8
preprocess:
- key: src
name: LoadImageFromFile
- key: ref
name: LoadImageFromFile
- input_keys:
- src
- ref
name: Transforms
pipeline:
- interpolation: bicubic
keys:
- image
- image
name: Resize
size:
- 256
- 256
- keys:
- image
- image
name: Transpose
- keys:
- image
- image
mean:
- 127.5
- 127.5
- 127.5
name: Normalize
std:
- 127.5
- 127.5
- 127.5
test_count: 16
train:
batch_size: 4
dataroot: data/stargan-v2/celeba_hq/train/
is_train: true
name: StarGANv2Dataset
num_workers: 8
preprocess:
- key: src
name: LoadImageFromFile
- key: ref
name: LoadImageFromFile
- key: ref2
name: LoadImageFromFile
- input_keys:
- src
- ref
- ref2
name: Transforms
pipeline:
- interpolation: bilinear
keys:
- image
- image
- image
name: RandomResizedCropProb
prob: 0.9
ratio:
- 0.9
- 1.1
scale:
- 0.8
- 1.0
size:
- 256
- 256
- interpolation: bilinear
keys:
- image
- image
- image
name: Resize
size:
- 256
- 256
- keys:
- image
- image
- image
name: RandomHorizontalFlip
prob: 0.5
- keys:
- image
- image
- image
name: Transpose
- keys:
- image
- image
- image
mean:
- 127.5
- 127.5
- 127.5
name: Normalize
std:
- 127.5
- 127.5
- 127.5
epochs: 200
is_train: true
log_config:
interval: 100
visiual_interval: 3000
lr_scheduler:
decay_epochs: 100
iters_per_epoch: 365
learning_rate: 0.0001
name: LinearDecay
start_epoch: 100
model:
discriminator:
img_size: 256
name: StarGANv2Discriminator
num_domains: 2
fan:
fname_pretrained: null
name: FAN
generator:
img_size: 256
name: StarGANv2Generator
style_dim: 64
w_hpf: 1
lambda_cyc: 1
lambda_ds: 1
lambda_sty: 1
latent_dim: 16
mapping:
latent_dim: 16
name: StarGANv2Mapping
num_domains: 2
style_dim: 64
name: StarGANv2Model
style:
img_size: 256
name: StarGANv2Style
num_domains: 2
style_dim: 64
optimizer:
discriminator:
beta1: 0.0
beta2: 0.99
name: Adam
net_names:
- discriminator
weight_decay: 0.0001
generator:
beta1: 0.0
beta2: 0.99
name: Adam
net_names:
- generator
weight_decay: 0.0001
mapping_network:
beta1: 0.0
beta2: 0.99
name: Adam
net_names:
- mapping_network
weight_decay: 0.0001
main(args, cfg)
File "F:\PaddleGAN\tools\main.py", line 46, in main
trainer.train()
File "F:\PaddleGAN\ppgan\engine\trainer.py", line 234, in train
self.model.train_iter(self.optimizers) # norm train
File "F:\PaddleGAN\ppgan\models\starganv2_model.py", line 279, in train_iter
d_loss, d_losses_latent = compute_d_loss(self.nets,
File "F:\PaddleGAN\ppgan\models\starganv2_model.py", line 64, in compute_d_loss
s_trg = nets['mapping_network'](z_trg, y_trg)
File "D:\ProgramData\miniconda3\envs\paddlegan\lib\site-packages\paddle\nn\layer\layers.py", line 1426, in call
return self.forward(*inputs, **kwargs)
File "F:\PaddleGAN\ppgan\models\generators\generator_starganv2.py", line 245, in forward
out[idx[i].numpy().astype(np.int_).tolist()[0],
TypeError: 'int' object is not subscriptable
感觉是numpy的版本问题,请问应该选择什么版本

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants