Skip to content

TF2 Migration, issue with L-BFGS-B #123

Open
@splicergroup

Description

@splicergroup

I was able to get this to work with Tensorflow 2 on Windows 10 by converting a couple things for compatibility. However I'm stumped on one problem regarding the optimizer portion of the code. The Adam optimizer works fine with optimizer = tf.compat.v1.train.AdamOptimizer(args.learning_rate)

The L-BFGS-B optimizer does not seem to work with Tensorflow 2 as it's been removed. This is the part that needs to be migrated to work with Tensorflow 2

optimizer = tf.contrib.opt.ScipyOptimizerInterface(
    loss, method='L-BFGS-B',
    options={'maxiter': args.max_iterations,
        'disp': print_iterations})

I looked into tfp.optimizer.lbfgs_minimize but I have no idea how to get it working in the existing code. Do you have any ideas? I am using Nvidia Ampere architecture cards (RTX 3090) that do not support Tensorflow 1.x due to CUDA compute version. Would really like to use L-BFGS instead of Adam for better results.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions