chanchanchan97 / ICAFusion

ICAFusion: Iterative Cross-Attention Guided Feature Fusion for Multispectral Object Detection, Pattern Recognition
GNU Affero General Public License v3.0
94 stars 7 forks source link

NameError: name 'global_var' is not defined #34

Open heiGT001 opened 2 months ago

heiGT001 commented 2 months ago

NameError: name 'global_var' is not defined Did the author upload this file?

qiherong commented 2 months ago

I have the same problem. Have you solved it

bhsud commented 1 month ago

I found it! create global_var.py and past following.

def _init(): # 初始化 global _global_dict _global_dict = {}

def set_value(key, value):

定义一个全局变量

_global_dict[key] = value

def get_value(key):

获得一个全局变量,不存在则提示读取对应变量失败

try:
    return _global_dict[key]
except:
    print('读取'+key+'失败\r\n')