cooolallen / Face-recognition-with-User-interface

Master Piece
6 stars 3 forks source link

Error while running the code #5

Open glitzflitz opened 5 years ago

glitzflitz commented 5 years ago

Where can we get the inception model?

network = importlib.import_module('models.inception_resnet_v1', 'inference')
  File "/usr/lib/python3.7/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1006, in _gcd_import
  File "<frozen importlib._bootstrap>", line 983, in _find_and_load
  File "<frozen importlib._bootstrap>", line 965, in _find_and_load_unlocked
ModuleNotFoundError: No module named 'models.inception_resnet_v1'
glitzflitz commented 5 years ago

Ok so just copied model directory from facenet and this error seemss to be gone. But now I'm getting different error

Traceback (most recent call last):
  File "Top.py", line 186, in <module>
    FR.build()
  File "/home/direwolf/stuff/Face-recognition-with-User-interface/FaceRecognizer.py", line 168, in build
    saver.restore(self._sess, os.path.join(self._facenet_model_dir, ckpt_file))
  File "/usr/lib/python3.7/site-packages/tensorflow/python/training/saver.py", line 1302, in restore
    err, "a Variable name or other graph key that is missing")
tensorflow.python.framework.errors_impl.NotFoundError: Restoring from checkpoint failed. This is most likely due to a Variable name or other graph key that is missing from the checkpoint. Please ensure that you have not altered the graph expected based on the checkpoint. Original error:

2 root error(s) found.
  (0) Not found: Tensor name "InceptionResnetV1/Bottleneck/BatchNorm/beta" not found in checkpoint files /home/direwolf/stuff/Face-recognition-with-User-interface/pretrained_models/FaceNet/model-20161116-234200.ckpt-80000
     [[node save/RestoreV2 (defined at /home/direwolf/stuff/Face-recognition-with-User-interface/FaceRecognizer.py:167) ]]
     [[save/RestoreV2/_301]]
  (1) Not found: Tensor name "InceptionResnetV1/Bottleneck/BatchNorm/beta" not found in checkpoint files /home/direwolf/stuff/Face-recognition-with-User-interface/pretrained_models/FaceNet/model-20161116-234200.ckpt-80000
     [[node save/RestoreV2 (defined at /home/direwolf/stuff/Face-recognition-with-User-interface/FaceRecognizer.py:167) ]]
0 successful operations.
0 derived errors ignored.
aleconwifi commented 5 years ago

What was the model directory of facenet and where did you copy it?

aleconwifi commented 5 years ago

I was copying the code here https://github.com/davidsandberg/facenet/tree/master/src/models. And I have a new error 2019-07-26 11:35:18.910564: I tensorflow/core/platform/cpu_feature_guard.cc:141] Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX AVX2 2019-07-26 11:35:18.916341: I tensorflow/core/common_runtime/process_util.cc:71] Creating new thread pool with default inter op setting: 8. Tune using inter_op_parallelism_threads for best performance. Load FaceDatabase from C:\Users\alema\OneDrive\Documents\tesis\Face-recognition-with-User-interface-master\data\database\database.pkl Top.py:185: DeprecationWarning: time.clock has been deprecated in Python 3.3 and will be removed from Python 3.8: use time.perf_counter or time.processtime instead tic = time.clock() Load FaceNet model checkpoint from model-20161116-234200.ckpt-80000 Traceback (most recent call last): File "Top.py", line 186, in FR.build() File "C:\Users\alema\OneDrive\Documents\tesis\Face-recognition-with-User-interface-master\FaceRecognizer.py", line 164, in build logits, = network.inference(self._images_placeholder, phase_train=False) TypeError: inference() missing 1 required positional argument: 'keep_probability' [ WARN:0] terminating async callback

Jumabek commented 5 years ago

@alejomarcano Yes, the code is not correct. It is not your problem. I recommend making your own network.inference function. You can study tensorflow docs for that