woctezuma / SimSwap-colab

Colab notebooks to apply SimSwap to images, animated GIF, and videos.
MIT License
86 stars 19 forks source link

simswap dont works #6

Closed nascacorp closed 1 year ago

nascacorp commented 1 year ago

hi pal, first of all thankyou for all your job, its awesome, last days ive getting this trouble:

/content/SimSwap /usr/local/lib/python3.8/dist-packages/torch/serialization.py:868: SourceChangeWarning: source code of class 'torch.nn.parallel.data_parallel.DataParallel' has changed. Saved a reverse patch to DataParallel.patch. Run patch -p0 < DataParallel.patch to revert your changes. warnings.warn(msg, SourceChangeWarning) /usr/local/lib/python3.8/dist-packages/torch/serialization.py:868: 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) /usr/local/lib/python3.8/dist-packages/torch/serialization.py:868: SourceChangeWarning: source code of class 'torch.nn.modules.batchnorm.BatchNorm2d' has changed. Saved a reverse patch to BatchNorm2d.patch. Run patch -p0 < BatchNorm2d.patch to revert your changes. warnings.warn(msg, SourceChangeWarning) /usr/local/lib/python3.8/dist-packages/torch/serialization.py:868: SourceChangeWarning: source code of class 'torch.nn.modules.activation.PReLU' has changed. Saved a reverse patch to PReLU.patch. Run patch -p0 < PReLU.patch to revert your changes. warnings.warn(msg, SourceChangeWarning) /usr/local/lib/python3.8/dist-packages/torch/serialization.py:868: SourceChangeWarning: source code of class 'torch.nn.modules.pooling.MaxPool2d' has changed. Saved a reverse patch to MaxPool2d.patch. Run patch -p0 < MaxPool2d.patch to revert your changes. warnings.warn(msg, SourceChangeWarning) /usr/local/lib/python3.8/dist-packages/torch/serialization.py:868: SourceChangeWarning: source code of class 'torch.nn.modules.container.Sequential' has changed. Saved a reverse patch to Sequential.patch. Run patch -p0 < Sequential.patch to revert your changes. warnings.warn(msg, SourceChangeWarning) /usr/local/lib/python3.8/dist-packages/torch/serialization.py:868: SourceChangeWarning: source code of class 'torch.nn.modules.pooling.AdaptiveAvgPool2d' has changed. Saved a reverse patch to AdaptiveAvgPool2d.patch. Run patch -p0 < AdaptiveAvgPool2d.patch to revert your changes. warnings.warn(msg, SourceChangeWarning) /usr/local/lib/python3.8/dist-packages/torch/serialization.py:868: SourceChangeWarning: source code of class 'torch.nn.modules.linear.Linear' has changed. Saved a reverse patch to Linear.patch. Run patch -p0 < Linear.patch to revert your changes. warnings.warn(msg, SourceChangeWarning) /usr/local/lib/python3.8/dist-packages/torch/serialization.py:868: SourceChangeWarning: source code of class 'torch.nn.modules.activation.Sigmoid' has changed. Saved a reverse patch to Sigmoid.patch. Run patch -p0 < Sigmoid.patch to revert your changes. warnings.warn(msg, SourceChangeWarning) /usr/local/lib/python3.8/dist-packages/torch/serialization.py:868: SourceChangeWarning: source code of class 'torch.nn.modules.dropout.Dropout' has changed. Saved a reverse patch to Dropout.patch. Run patch -p0 < Dropout.patch to revert your changes. warnings.warn(msg, SourceChangeWarning) /usr/local/lib/python3.8/dist-packages/torch/serialization.py:868: SourceChangeWarning: source code of class 'torch.nn.modules.batchnorm.BatchNorm1d' has changed. Saved a reverse patch to BatchNorm1d.patch. Run patch -p0 < BatchNorm1d.patch to revert your changes. warnings.warn(msg, SourceChangeWarning) Traceback (most recent call last): File "test_wholeimage_swapsingle.py", line 51, in model = create_model(opt) File "/content/SimSwap/models/models.py", line 18, in create_model model.initialize(opt) File "/content/SimSwap/models/fs_model.py", line 67, in initialize netArc_checkpoint = torch.load(netArc_checkpoint) File "/usr/local/lib/python3.8/dist-packages/torch/serialization.py", line 795, in load return _legacy_load(opened_file, map_location, pickle_module, **pickle_load_args) File "/usr/local/lib/python3.8/dist-packages/torch/serialization.py", line 1012, in _legacy_load result = unpickler.load() File "/usr/local/lib/python3.8/dist-packages/torch/optim/sgd.py", line 112, in setstate super().setstate(state) File "/usr/local/lib/python3.8/dist-packages/torch/optim/optimizer.py", line 84, in setstate self.defaults.setdefault('differentiable', False) AttributeError: 'SGD' object has no attribute 'defaults'

thanks!!

woctezuma commented 1 year ago

Right.

Traceback (most recent call last):
  File "test_wholeimage_swapsingle.py", line 51, in <module>
    model = create_model(opt)
  File "/content/SimSwap/models/models.py", line 18, in create_model
    model.initialize(opt)
  File "/content/SimSwap/models/fs_model.py", line 67, in initialize
    netArc_checkpoint = torch.load(netArc_checkpoint)
  File "/usr/local/lib/python3.8/dist-packages/torch/serialization.py", line 795, in load
    return _legacy_load(opened_file, map_location, pickle_module, **pickle_load_args)
  File "/usr/local/lib/python3.8/dist-packages/torch/serialization.py", line 1012, in _legacy_load
    result = unpickler.load()
  File "/usr/local/lib/python3.8/dist-packages/torch/optim/sgd.py", line 112, in __setstate__
    super().__setstate__(state)
  File "/usr/local/lib/python3.8/dist-packages/torch/optim/optimizer.py", line 84, in __setstate__
    self.defaults.setdefault('differentiable', False)
AttributeError: 'SGD' object has no attribute 'defaults'

Related: