简体   繁体   English

Tensorflow 2 中 ScipyOptimizerInterface 的替代品是什么?

[英]What's the replacement for ScipyOptimizerInterface in Tensorflow 2?

I want to experiment with Manumorph - A Tensorflow implementation of Deep Painterly Harmonization .我想尝试Manumorph - A Tensorflow 实现 Deep Painterly Harmonization

Unfortunately, I had zero success so far.不幸的是,到目前为止我的成功率为零。 I followed the instructions, but the current version of Tensorflow is not compatible with this implementation.我按照说明进行操作,但当前版本的 Tensorflow 与此实现不兼容。 I already updated the code with the Tensorflow tool tf_upgrade_v2.py .我已经使用 Tensorflow 工具tf_upgrade_v2.py更新了代码。 The script reported that tensorflow. contrib该脚本报告了tensorflow. contrib tensorflow. contrib is not supported anymore. tensorflow. contrib不再受支持。

I also tried installing Tensorflow 1.15 but this version gives me DLL errors that I don't know how to solve.我也尝试安装 Tensorflow 1.15 但这个版本给了我 DLL 错误,我不知道如何解决。

I am new to Tensorflow and don't know what any of the code does.我是 Tensorflow 的新手,不知道任何代码的作用。 I hope someone with experience in Tensorflow can tell how I can make the line我希望有 Tensorflow 经验的人能告诉我如何制作这条线

train_step = tf.contrib.opt.ScipyOptimizerInterface(loss, 
                        var_list=[combination_im], 
                        options={'maxfun':20})

in main.py work with Tensorflow 2.main.py中使用 Tensorflow 2。

(Left this same answer in Use Scipy Optimizer with Tensorflow 2.0 for Neural Network training ) (在Use Scipy Optimizer with Tensorflow 2.0 for Neural Network training中留下了同样的答案)

If you'd like something even more drag-and-drop for interfacing TF2 with solvers from scipy.optimize.minimize solver) you could take a look at this and see if it fits your use case:如果您想要更多的拖放功能来将 TF2 与来自scipy.optimize.minimize求解器的求解器连接起来),您可以看看这个,看看它是否适合您的用例:

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM