Code Monkey home page Code Monkey logo

Comments (6)

williamyang1991 avatar williamyang1991 commented on August 15, 2024

你提供的信息过少,我没法帮你

from dualstylegan.

Xia-zx avatar Xia-zx commented on August 15, 2024

你提供的信息过少,我没法帮你

我按照readme中说的,下载了cartoon的generator.pt按照要求目录存放,运行python style_transfer.py ,在76行generator.load_state_dict(ckpt["g_ema"]),出现报错

from dualstylegan.

williamyang1991 avatar williamyang1991 commented on August 15, 2024

至少提供你输入的命令行吧

from dualstylegan.

Xia-zx avatar Xia-zx commented on August 15, 2024

python style_transfer.py

完全按照readme中说的,命令行就是python style_transfer.py ,没提供参数

from dualstylegan.

williamyang1991 avatar williamyang1991 commented on August 15, 2024

那我只能猜测你模型下载错了
你可以试着下载一下其他风格的,比如caricature,然后运行一下

python style_transfer.py --style caricature --name caricature_transfer --style_id 0 --weight 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1

看是不是报一样的错。
如果没报错就是你下载的有问题
如果也报错,那可能是代码哪里有问题(但是那么多人都试过了一直都没啥问题),你可以试一下添加

generator.load_state_dict(ckpt["g_ema"], strict=False)

去忽略那些unexpected key

from dualstylegan.

Xia-zx avatar Xia-zx commented on August 15, 2024

那我只能猜测你模型下载错了 你可以试着下载一下其他风格的,比如caricature,然后运行一下

python style_transfer.py --style caricature --name caricature_transfer --style_id 0 --weight 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1

看是不是报一样的错。 如果没报错就是你下载的有问题 如果也报错,那可能是代码哪里有问题(但是那么多人都试过了一直都没啥问题),你可以试一下添加

generator.load_state_dict(ckpt["g_ema"], strict=False)

去忽略那些unexpected key

添加

generator.load_state_dict(ckpt["g_ema"], strict=False)

后就好了,感谢帮助

from dualstylegan.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.