在这里输入图像描述!python encode_images.py --优化器=lbfgs--face_encode_images.py=True--迭代=6--use_lpips_encode_images.py=0-use_encode_images.py_encode_images.py=0--输出_encode_images.py=True准直_encode_images.py/生成_映像/潜在_表示/
打印(“\n*潜伏代码优化完成!*
2021-08-24 13:33:11.033451: i tensorflow/stream_executor/platform/default/dso_loader.cc:48]成功地打开了动态库cudart64_101.dll
回溯(最近一次调用):文件"encode_images.py",第12行,在导入dnnlib.tflib中作为tflib文件"C:\Users\bkvij\Office快速创新\StyleGAN变形- Arxiv dnnlib.tflib第8行,在
发自。导入自动摘要文件"C:\Users\bkvij\Office快速创新\StyleGAN面变形- Arxiv Insights\stylegan-encoder\dnnlib\tflib\autosummary.py",第31行,在
发自。导入tfutil文件"C:\Users\bkvij\Office快速创新\StyleGAN面变形- Arxiv Insights\stylegan-encoder\dnnlib\tflib\tfutil.py",第34行,在
def shape_to_list(shape: Iterabletf.Dimension) ->列表[Unionint,None]:AttributeError:模块'tensorflow‘没有属性’维度‘
发布于 2021-10-31 07:55:18
这是因为tf.Dimension被否决了。
转到stylegan/dnnlib/tflib/tfutil.py并将第34行中的tf.Dimension更改为tf.compat.v1.Dimension。
发布于 2022-06-26 00:14:12
我认为您使用的是TensorFlow v2,使用google v2会解决问题,否则,您需要使用Python3.6 TensorFlow 1.10 cuDNN 7.3.1创建一个虚拟环境,它将解决这个问题。
发布于 2022-08-21 23:55:54
要扩展Faezeh的答案,您必须对tfutils.py做以下编辑
来自tf.Dimension (第34行) tf.variable_scope (第74行) tf.Session (第128行)
致tf.compat.v1.Dimension tf.compat.v1.variable_scope tf.compat.v1.Session
或者,你可以下载tensorflow 1.x,省去麻烦
https://stackoverflow.com/questions/68906225
复制相似问题