问题遇到的现象和发生背景
在github上clone了fsgan的代码,按照提示创建conda虚拟环境并且配置环境变量。
fsgan的仓库被clone在了D:\Desktop,所以环境变量我设置为D:\Desktop
我先是运行swap.py,按照提示,运行以下command:(一点没动,不用修改的示例)
python fsgan/inference/swap.py docs/examples/shinzo_abe.mp4 -t docs/examples/conan_obrien.mp4 -o . --finetune --finetune_save --seg_remove_mouth
结果缺抛出这样的错误:ModuleNotFoundError: No module named 'fsgan.preprocess'
之后,我又运行了reenact.py,运行如下command:
python fsgan\inference\reenact.py D:\Desktop\000012.jpg -t D:\Desktop\fsgan\docs\examples\conan_obrien.mp4 -o D:\Desktop
然而,还是同样的错误,ModuleNotFoundError: No module named 'fsgan.preprocess'
我的解答思路和尝试过的方法
fsgan.preprocess 是存在的。因为,我在reenact.py 和swap.py 的同一目录下创建了一个mytest.py的测试文件,将出错的导入复制进去,并且在导入的模块的同一路径下创建了 myimport.py文件。直接run,mytest.py是可以运行的,并打印出来模块所在的路径。
但是,如果使用命令行来运行,mytest.py会报出同样的错误。
我想要达到的结果
可以正常运行swap.py和reenact.py