PRBonn / StyleGenForLabels

StyleGAN-based generation of labels for crop-weed segmentation
MIT License
12 stars 2 forks source link

error while loading model #4

Closed rohitdhote111 closed 5 months ago

rohitdhote111 commented 6 months ago

Hi Yue Linn Chong, Thanks for your reply on the previous issue.

I am running "generate_mit_latents.py" file to get the latent variable w and the image that the StyleGAN2 generates with said w. For this I am using saved model provided along with repo as "stylegan2_weights.pt".

But I am getting error as follows

command: python generate_mit_latents.py --size 256 --sample 1 --pics 500 --ckpt /home/workspace/stylegan2_weights.pt --out_path ./styleinversion_trainset

error: image

I think Reason for error may be:

model architecture changes, model compatibility issue, model partial loading and to solve this issue we need access to model code.

Also, For training F(EN) encoder, where can I find the "train.py" file.

yuelinn commented 6 months ago

Hi Rohit,

thanks for the detailed issue. The issue with the script generate_mit_latents.py should not happen. I will try to replicate the problem and fix it next week. If you are looking for the training script for the weights of stylegan2_weights.pt, the training script is in stylegan2-pytorch/train.py. Similarly, the training for F(EN) encoder is in the pixel2style2pixel/scripts/train.py but I checked this is not the latest version for the training of F(EN). Sorry about that, I will upload the correct train script for the F(EN) next week as well.

yuelinn commented 5 months ago

Hi Rohit,

I notice you are using the weights I uploaded. This model outputs image size of 512 so you should run with the correct image size. For example : python generate_mit_latents.py --size 512 --sample 1 --pics 10 --ckpt stylegan2_weights.pt --out_ path ../artifacts