카테고리 없음

[에러코드] module 'tensorflow.python.keras.utils.generic_utils' has no attribute 'populate_dict_with_module_objects'

Minding 2021. 5. 21. 14:29
728x90
반응형

DeepSort 실습 중 발생한 에러.

 

Keras의 util.generic_utils에서 populate_dict_with_module_objects 기능을 찾지못해 발생하는 에러이다.

 

Tf-nightly 버젼을 삭제하고, tensorflow를 최신버젼으로 업데이트 하는 해결 방법도 있는데,

내 경우는 Deepsort와 버젼 호환성이 맞지 않아서 다른 해결방법을 찾았다.

 

Tensorflow의 Github에서 직접 해당 function을 찾아 내 컴퓨터의 같은 부분에 추가하였다.

https://github.com/tensorflow/tensorflow/blob/master/tensorflow/python/keras/utils/generic_utils.py

 

tensorflow/tensorflow

An Open Source Machine Learning Framework for Everyone - tensorflow/tensorflow

github.com

def populate_dict_with_module_objects(target_dict, modules, obj_filter):
  for module in modules:
    for name in dir(module):
      obj = getattr(module, name)
      if obj_filter(obj):
        target_dict[name] = obj

해당 부분을 복사하여 tensorflow/keras의 genetic_utils.py에 붙여넣으면 된다.

728x90