Can’t save BCQ model implemented using Tensorflow as a SavedModel because it is not a Tensorflow object
I am trying to save a batch-constrained Q-learning model written by AurelianTactics (code repo here) with the end goal of converting to TFLite. The BCQ class is written with TensorFlow functions but is not itself a TensorFlow class object. The existing code saves the model using a function that calls tf.compat.v1.train.Saver()
, which saves the into checkpoint file and ckpt files with .data-00000-of-00001, .index, .meta extensions. To my knowledge these only save model weights, etc. and not the actual model itself, so the model class file can read and continue training it but without the base code you cannot select an action. In addition, you cannot convert the files to a TensorFlow Lite model. Attempting to use tf.saved_model.save()
gives the error