soubhiksanyal / RingNet

Learning to Regress 3D Face Shape and Expression from an Image without 3D Supervision
https://ringnet.is.tue.mpg.de
MIT License
814 stars 170 forks source link

Any suggestion on run RingNet with Python 3.6.8 and Windows 10? #61

Open drrobincroft opened 3 years ago

drrobincroft commented 3 years ago

I have downloaded the source code and models of RingNet and tried days to make it work on Python 3.6.8 and Windows 10. But it is constantly throwing bugs like follows tensorflow.python.framework.errors_impl.InvalidArgumentError: Cannot assign a device for operation Flamenetnormal/strided_slice_5: node Flamenetnormal/strided_slice_5 (defined at Python\Python36\lib\site-packages\tensorflow_core\python\framework\ops.py:1748) was explicitly assigned to /device:GPU:* but available devices are [ /job:localhost/replica:0/task:0/device:CPU:0 ]. Make sure the device specification refers to a valid device. and tensorflow.python.framework.errors_impl.InvalidArgumentError: Restoring from checkpoint failed. This is most likely due to a mismatch between the current graph and the graph from the checkpoint. Please ensure that you have not altered the graph expected based on the checkpoint. Do you have any idea about it?

I already know it stuck here in demo.py. ... def main(config, template_mesh): sess = tf.Session() model = RingNet_inference(config, sess=sess) input_img, proc_param, img = preprocess_image(config.img_path) vertices, flame_parameters = model.predict(np.expand_dims(input_img, axis=0), get_parameters=True) cams = flame_parameters[0][:3] ...

Fsajjad99 commented 3 years ago

I was running on python 2.7 but from my experience, this error was thrown because of version mismatch in tensorflow, cuda and cudnn libraries. Perhaps looking into those would be helpful

XRarach commented 1 year ago

Also tried porting this to python3 and failed, I would be very interested in the results of this article in comparison to Flame itself in terms of speed.