sjtuplayer / anomalydiffusion

[AAAI 2024] AnomalyDiffusion: Few-Shot Anomaly Image Generation with Diffusion Model
MIT License
114 stars 14 forks source link

"x" why is [1,256,256,256]?how to solve it ? #23

Closed boxbox2 closed 1 month ago

boxbox2 commented 4 months ago

image

image

OceanWong1991 commented 4 months ago

RuntimeError: Given groups=1, weight of size [64, 3, 3, 3], expected input[1, 256, 256, 256] to have 3 channels, but got 256 channels instead same... @sjtuplayer

OceanWong1991 commented 4 months ago

Add more detials, when I run this command: CUDA_VISIBLE_DEVICES=0 python main.py --spatial_encoder_embedding --data_enhance --base configs/latent-diffusion/txt2img-1p4B-finetune-encoder+embedding.yaml -t --actual_resume /home/ai/projects/anomalydiffusion/models/ldm/text2img-large/model.ckpt -n test --gpus 0 --init_word anomaly --mvtec_path=/home/ai//mvtec_anomaly_detection

@sjtuplayer Thanks, Any help would be appreciated!

sjtuplayer commented 4 months ago

Maybe you should change batch size from 1 to a number larger than 1(e.g., 2 or 4). I think this is caused by some torch.squeeze() operation.