Why i get error in newest SimSwap github ver. #169

Open
opened 2021-12-05 22:45:25 +01:00 by alloidiota · 3 comments
alloidiota commented 2021-12-05 22:45:25 +01:00 (Migrated from github.com)

In general, I downloaded the latest version of simswap from the github and replaced the old files with new in simswap env folder, and now I get errors and no difference crop 224 or 512. Before worked all good. Even full deleting and reinstall simswap and anaconda not work.

(C:\Users\Default\Desktop\SimSwap\simswap) PS C:\Users\Default\Desktop\SimSwap\simswap> python test_one_image.py --crop_size 224 --use_mask --no_simswaplogo --name people --Arc_path arcface_model/arcface_checkpoint.tar --pic_a_path 1.jpg --pic_b_path 1.png --output_path oksi.png
------------ Options -------------
Arc_path: arcface_model/arcface_checkpoint.tar
aspect_ratio: 1.0
batchSize: 8
checkpoints_dir: ./checkpoints
cluster_path: features_clustered_010.npy
crop_size: 224
data_type: 32
dataroot: ./datasets/cityscapes/
display_winsize: 512
engine: None
export_onnx: None
feat_num: 3
fineSize: 512
fp16: False
gpu_ids: [0]
how_many: 50
id_thres: 0.03
image_size: 224
input_nc: 3
instance_feat: False
isTrain: False
label_feat: False
label_nc: 0
latent_size: 512
loadSize: 1024
load_features: False
local_rank: 0
max_dataset_size: inf
model: pix2pixHD
multisepcific_dir: ./demo_file/multispecific
nThreads: 2
n_blocks_global: 6
n_blocks_local: 3
n_clusters: 10
n_downsample_E: 4
n_downsample_global: 3
n_local_enhancers: 1
name: people
nef: 16
netG: global
ngf: 64
niter_fix_global: 0
no_flip: False
no_instance: False
no_simswaplogo: True
norm: batch
norm_G: spectralspadesyncbatch3x3
ntest: inf
onnx: None
output_nc: 3
output_path: oksi.png
phase: test
pic_a_path: 1.jpg
pic_b_path: 1.png
pic_specific_path: ./crop_224/zrf.jpg
resize_or_crop: scale_width
results_dir: ./results/
semantic_nc: 3
serial_batches: False
temp_path: ./temp_results
tf_log: False
use_dropout: False
use_encoded_image: False
use_mask: True
verbose: False
video_path: ./demo_file/multi_people_1080p.mp4
which_epoch: latest
-------------- End ----------------
C:\Users\Default\Desktop\SimSwap\simswap\lib\site-packages\torch\serialization.py:671: SourceChangeWarning: source code of class 'torch.nn.parallel.data_parallel.DataParallel' has changed. Tried to save a patch, but couldn't create a writable file DataParallel.patch. Make sure it doesn't exist and your working directory is writable.
  warnings.warn(msg, SourceChangeWarning)
C:\Users\Default\Desktop\SimSwap\simswap\lib\site-packages\torch\serialization.py:671: SourceChangeWarning: source code of class 'torch.nn.modules.conv.Conv2d' has changed. Tried to save a patch, but couldn't create a writable file Conv2d.patch. Make sure it doesn't exist and your working directory is writable.
  warnings.warn(msg, SourceChangeWarning)
C:\Users\Default\Desktop\SimSwap\simswap\lib\site-packages\torch\serialization.py:671: SourceChangeWarning: source code of class 'torch.nn.modules.batchnorm.BatchNorm2d' has changed. Tried to save a patch, but couldn't create a writable file BatchNorm2d.patch. Make sure it doesn't exist and your working directory is writable.
  warnings.warn(msg, SourceChangeWarning)
C:\Users\Default\Desktop\SimSwap\simswap\lib\site-packages\torch\serialization.py:671: SourceChangeWarning: source code of class 'torch.nn.modules.activation.PReLU' has changed. Tried to save a patch, but couldn't create a writable file PReLU.patch. Make sure it doesn't exist and your working directory is writable.
  warnings.warn(msg, SourceChangeWarning)
C:\Users\Default\Desktop\SimSwap\simswap\lib\site-packages\torch\serialization.py:671: SourceChangeWarning: source code of class 'torch.nn.modules.pooling.MaxPool2d' has changed. Tried to save a patch, but couldn't create a writable file MaxPool2d.patch. Make sure it doesn't exist and your working directory is writable.
  warnings.warn(msg, SourceChangeWarning)
C:\Users\Default\Desktop\SimSwap\simswap\lib\site-packages\torch\serialization.py:671: SourceChangeWarning: source code of class 'torch.nn.modules.container.Sequential' has changed. Tried to save a patch, but couldn't create a writable file Sequential.patch. Make sure it doesn't exist and your working directory is writable.
  warnings.warn(msg, SourceChangeWarning)
C:\Users\Default\Desktop\SimSwap\simswap\lib\site-packages\torch\serialization.py:671: SourceChangeWarning: source code of class 'torch.nn.modules.pooling.AdaptiveAvgPool2d' has changed. Tried to save a patch, but couldn't create a writable file AdaptiveAvgPool2d.patch. Make sure it doesn't exist and your working directory is writable.
  warnings.warn(msg, SourceChangeWarning)
C:\Users\Default\Desktop\SimSwap\simswap\lib\site-packages\torch\serialization.py:671: SourceChangeWarning: source code of class 'torch.nn.modules.linear.Linear' has changed. Tried to save a patch, but couldn't create a writable file Linear.patch. Make sure it doesn't exist and your working directory is writable.
  warnings.warn(msg, SourceChangeWarning)
C:\Users\Default\Desktop\SimSwap\simswap\lib\site-packages\torch\serialization.py:671: SourceChangeWarning: source code of class 'torch.nn.modules.activation.Sigmoid' has changed. Tried to save a patch, but couldn't create a writable file Sigmoid.patch. Make sure it doesn't exist and your working directory is writable.
  warnings.warn(msg, SourceChangeWarning)
C:\Users\Default\Desktop\SimSwap\simswap\lib\site-packages\torch\serialization.py:671: SourceChangeWarning: source code of class 'torch.nn.modules.dropout.Dropout' has changed. Tried to save a patch, but couldn't create a writable file Dropout.patch. Make sure it doesn't exist and your working directory is writable.
  warnings.warn(msg, SourceChangeWarning)
C:\Users\Default\Desktop\SimSwap\simswap\lib\site-packages\torch\serialization.py:671: SourceChangeWarning: source code of class 'torch.nn.modules.batchnorm.BatchNorm1d' has changed. Tried to save a patch, but couldn't create a writable file BatchNorm1d.patch. Make sure it doesn't exist and your working directory is writable.
  warnings.warn(msg, SourceChangeWarning)
C:\Users\Default\Desktop\SimSwap\simswap\lib\site-packages\torch\nn\functional.py:3631: UserWarning: Default upsampling behavior when mode=bilinear is changed to align_corners=False since 0.4.0. Please specify align_corners=True if the old behavior is desired. See the documentation of nn.Upsample for details.
  warnings.warn(
Traceback (most recent call last):
  File "C:\Users\Default\Desktop\SimSwap\simswap\test_one_image.py", line 64, in <module>
    img_fake = model(img_id, img_att, latend_id, latend_id, True)
  File "C:\Users\Default\Desktop\SimSwap\simswap\lib\site-packages\torch\nn\modules\module.py", line 1102, in _call_impl
    return forward_call(*input, **kwargs)
  File "C:\Users\Default\Desktop\SimSwap\simswap\models\fs_model.py", line 154, in forward
    img_fake = self.netG.forward(img_att, latent_id)
  File "C:\Users\Default\Desktop\SimSwap\simswap\models\fs_networks.py", line 157, in forward
    x = self.up2(x)
  File "C:\Users\Default\Desktop\SimSwap\simswap\lib\site-packages\torch\nn\modules\module.py", line 1102, in _call_impl
    return forward_call(*input, **kwargs)
  File "C:\Users\Default\Desktop\SimSwap\simswap\lib\site-packages\torch\nn\modules\container.py", line 141, in forward
    input = module(input)
  File "C:\Users\Default\Desktop\SimSwap\simswap\lib\site-packages\torch\nn\modules\module.py", line 1102, in _call_impl
    return forward_call(*input, **kwargs)
  File "C:\Users\Default\Desktop\SimSwap\simswap\lib\site-packages\torch\nn\modules\upsampling.py", line 141, in forward
    return F.interpolate(input, self.size, self.scale_factor, self.mode, self.align_corners)
  File "C:\Users\Default\Desktop\SimSwap\simswap\lib\site-packages\torch\nn\functional.py", line 3731, in interpolate
    return torch._C._nn.upsample_bilinear2d(input, output_size, align_corners, scale_factors)
RuntimeError: CUDA out of memory. Tried to allocate 344.00 MiB (GPU 0; 3.00 GiB total capacity; 1.09 GiB already allocated; 82.43 MiB free; 1.68 GiB reserved in total by PyTorch) If reserved memory is >> allocated memory try setting max_split_size_mb to avoid fragmentation.  See documentation for Memory Management and PYTORCH_CUDA_ALLOC_CONF

Plus Preparation.md wrong info path now:

Unzip checkpoints.zip, place it in the root dir ./
Its should be:
Unzip checkpoints.zip, place it in ./checkpoints/
Since checkpoints.zip contain only "people" folder.
So full path would be ./checkpoints/people/*

In general, I downloaded the latest version of simswap from the github and replaced the old files with new in simswap env folder, and now I get errors and no difference crop 224 or 512. Before worked all good. Even full deleting and reinstall simswap and anaconda not work. ``` (C:\Users\Default\Desktop\SimSwap\simswap) PS C:\Users\Default\Desktop\SimSwap\simswap> python test_one_image.py --crop_size 224 --use_mask --no_simswaplogo --name people --Arc_path arcface_model/arcface_checkpoint.tar --pic_a_path 1.jpg --pic_b_path 1.png --output_path oksi.png ------------ Options ------------- Arc_path: arcface_model/arcface_checkpoint.tar aspect_ratio: 1.0 batchSize: 8 checkpoints_dir: ./checkpoints cluster_path: features_clustered_010.npy crop_size: 224 data_type: 32 dataroot: ./datasets/cityscapes/ display_winsize: 512 engine: None export_onnx: None feat_num: 3 fineSize: 512 fp16: False gpu_ids: [0] how_many: 50 id_thres: 0.03 image_size: 224 input_nc: 3 instance_feat: False isTrain: False label_feat: False label_nc: 0 latent_size: 512 loadSize: 1024 load_features: False local_rank: 0 max_dataset_size: inf model: pix2pixHD multisepcific_dir: ./demo_file/multispecific nThreads: 2 n_blocks_global: 6 n_blocks_local: 3 n_clusters: 10 n_downsample_E: 4 n_downsample_global: 3 n_local_enhancers: 1 name: people nef: 16 netG: global ngf: 64 niter_fix_global: 0 no_flip: False no_instance: False no_simswaplogo: True norm: batch norm_G: spectralspadesyncbatch3x3 ntest: inf onnx: None output_nc: 3 output_path: oksi.png phase: test pic_a_path: 1.jpg pic_b_path: 1.png pic_specific_path: ./crop_224/zrf.jpg resize_or_crop: scale_width results_dir: ./results/ semantic_nc: 3 serial_batches: False temp_path: ./temp_results tf_log: False use_dropout: False use_encoded_image: False use_mask: True verbose: False video_path: ./demo_file/multi_people_1080p.mp4 which_epoch: latest -------------- End ---------------- C:\Users\Default\Desktop\SimSwap\simswap\lib\site-packages\torch\serialization.py:671: SourceChangeWarning: source code of class 'torch.nn.parallel.data_parallel.DataParallel' has changed. Tried to save a patch, but couldn't create a writable file DataParallel.patch. Make sure it doesn't exist and your working directory is writable. warnings.warn(msg, SourceChangeWarning) C:\Users\Default\Desktop\SimSwap\simswap\lib\site-packages\torch\serialization.py:671: SourceChangeWarning: source code of class 'torch.nn.modules.conv.Conv2d' has changed. Tried to save a patch, but couldn't create a writable file Conv2d.patch. Make sure it doesn't exist and your working directory is writable. warnings.warn(msg, SourceChangeWarning) C:\Users\Default\Desktop\SimSwap\simswap\lib\site-packages\torch\serialization.py:671: SourceChangeWarning: source code of class 'torch.nn.modules.batchnorm.BatchNorm2d' has changed. Tried to save a patch, but couldn't create a writable file BatchNorm2d.patch. Make sure it doesn't exist and your working directory is writable. warnings.warn(msg, SourceChangeWarning) C:\Users\Default\Desktop\SimSwap\simswap\lib\site-packages\torch\serialization.py:671: SourceChangeWarning: source code of class 'torch.nn.modules.activation.PReLU' has changed. Tried to save a patch, but couldn't create a writable file PReLU.patch. Make sure it doesn't exist and your working directory is writable. warnings.warn(msg, SourceChangeWarning) C:\Users\Default\Desktop\SimSwap\simswap\lib\site-packages\torch\serialization.py:671: SourceChangeWarning: source code of class 'torch.nn.modules.pooling.MaxPool2d' has changed. Tried to save a patch, but couldn't create a writable file MaxPool2d.patch. Make sure it doesn't exist and your working directory is writable. warnings.warn(msg, SourceChangeWarning) C:\Users\Default\Desktop\SimSwap\simswap\lib\site-packages\torch\serialization.py:671: SourceChangeWarning: source code of class 'torch.nn.modules.container.Sequential' has changed. Tried to save a patch, but couldn't create a writable file Sequential.patch. Make sure it doesn't exist and your working directory is writable. warnings.warn(msg, SourceChangeWarning) C:\Users\Default\Desktop\SimSwap\simswap\lib\site-packages\torch\serialization.py:671: SourceChangeWarning: source code of class 'torch.nn.modules.pooling.AdaptiveAvgPool2d' has changed. Tried to save a patch, but couldn't create a writable file AdaptiveAvgPool2d.patch. Make sure it doesn't exist and your working directory is writable. warnings.warn(msg, SourceChangeWarning) C:\Users\Default\Desktop\SimSwap\simswap\lib\site-packages\torch\serialization.py:671: SourceChangeWarning: source code of class 'torch.nn.modules.linear.Linear' has changed. Tried to save a patch, but couldn't create a writable file Linear.patch. Make sure it doesn't exist and your working directory is writable. warnings.warn(msg, SourceChangeWarning) C:\Users\Default\Desktop\SimSwap\simswap\lib\site-packages\torch\serialization.py:671: SourceChangeWarning: source code of class 'torch.nn.modules.activation.Sigmoid' has changed. Tried to save a patch, but couldn't create a writable file Sigmoid.patch. Make sure it doesn't exist and your working directory is writable. warnings.warn(msg, SourceChangeWarning) C:\Users\Default\Desktop\SimSwap\simswap\lib\site-packages\torch\serialization.py:671: SourceChangeWarning: source code of class 'torch.nn.modules.dropout.Dropout' has changed. Tried to save a patch, but couldn't create a writable file Dropout.patch. Make sure it doesn't exist and your working directory is writable. warnings.warn(msg, SourceChangeWarning) C:\Users\Default\Desktop\SimSwap\simswap\lib\site-packages\torch\serialization.py:671: SourceChangeWarning: source code of class 'torch.nn.modules.batchnorm.BatchNorm1d' has changed. Tried to save a patch, but couldn't create a writable file BatchNorm1d.patch. Make sure it doesn't exist and your working directory is writable. warnings.warn(msg, SourceChangeWarning) C:\Users\Default\Desktop\SimSwap\simswap\lib\site-packages\torch\nn\functional.py:3631: UserWarning: Default upsampling behavior when mode=bilinear is changed to align_corners=False since 0.4.0. Please specify align_corners=True if the old behavior is desired. See the documentation of nn.Upsample for details. warnings.warn( Traceback (most recent call last): File "C:\Users\Default\Desktop\SimSwap\simswap\test_one_image.py", line 64, in <module> img_fake = model(img_id, img_att, latend_id, latend_id, True) File "C:\Users\Default\Desktop\SimSwap\simswap\lib\site-packages\torch\nn\modules\module.py", line 1102, in _call_impl return forward_call(*input, **kwargs) File "C:\Users\Default\Desktop\SimSwap\simswap\models\fs_model.py", line 154, in forward img_fake = self.netG.forward(img_att, latent_id) File "C:\Users\Default\Desktop\SimSwap\simswap\models\fs_networks.py", line 157, in forward x = self.up2(x) File "C:\Users\Default\Desktop\SimSwap\simswap\lib\site-packages\torch\nn\modules\module.py", line 1102, in _call_impl return forward_call(*input, **kwargs) File "C:\Users\Default\Desktop\SimSwap\simswap\lib\site-packages\torch\nn\modules\container.py", line 141, in forward input = module(input) File "C:\Users\Default\Desktop\SimSwap\simswap\lib\site-packages\torch\nn\modules\module.py", line 1102, in _call_impl return forward_call(*input, **kwargs) File "C:\Users\Default\Desktop\SimSwap\simswap\lib\site-packages\torch\nn\modules\upsampling.py", line 141, in forward return F.interpolate(input, self.size, self.scale_factor, self.mode, self.align_corners) File "C:\Users\Default\Desktop\SimSwap\simswap\lib\site-packages\torch\nn\functional.py", line 3731, in interpolate return torch._C._nn.upsample_bilinear2d(input, output_size, align_corners, scale_factors) RuntimeError: CUDA out of memory. Tried to allocate 344.00 MiB (GPU 0; 3.00 GiB total capacity; 1.09 GiB already allocated; 82.43 MiB free; 1.68 GiB reserved in total by PyTorch) If reserved memory is >> allocated memory try setting max_split_size_mb to avoid fragmentation. See documentation for Memory Management and PYTORCH_CUDA_ALLOC_CONF ``` Plus Preparation.md wrong info path now: >Unzip checkpoints.zip, place it in the root dir ./ Its should be: >Unzip checkpoints.zip, place it in ./checkpoints/ Since checkpoints.zip contain only "people" folder. So full path would be ./checkpoints/people/*
monument-and-sea-all-the-gift commented 2021-12-07 02:53:57 +01:00 (Migrated from github.com)

the error is CUDA out of memory means that GPUS have not enough memory,you need to change gpus

the error is CUDA out of memory means that GPUS have not enough memory,you need to change gpus
alloidiota commented 2021-12-07 14:15:08 +01:00 (Migrated from github.com)

the error is CUDA out of memory means that GPUS have not enough memory,you need to change gpus

Dude. I am not that retarded. Its not about gpu, i said already previous version worked good, i encoded for 1 hour videos without splitting them on parts, but cant swap 1 picture now.

> the error is CUDA out of memory means that GPUS have not enough memory,you need to change gpus Dude. I am not that retarded. Its not about gpu, i said already previous version worked good, i encoded for 1 hour videos without splitting them on parts, but cant swap 1 picture now.
fajarmf94 commented 2022-11-05 14:24:27 +01:00 (Migrated from github.com)

you need to reduce your picture to 1024 px

you need to reduce your picture to 1024 px
Sign in to join this conversation.