OpenNE icon indicating copy to clipboard operation
OpenNE copied to clipboard

Using Citesser dataset will raise this error: __init__() got an unexpected keyword argument 'silent'

Open Felicialalala opened this issue 2 years ago • 0 comments

The completed error meassage: Traceback (most recent call last): File "/usr/lib/python3.6/runpy.py", line 193, in _run_module_as_main "__main__", mod_spec) File "/usr/lib/python3.6/runpy.py", line 85, in _run_code exec(code, run_globals) File "/yitingyang/OpenNE-pytorch/src/openne/__main__.py", line 239, in <module> main(parse_args()) File "/yitingyang/OpenNE-pytorch/src/openne/__main__.py", line 226, in main graph = Graph(silent=train_args['silent']) # prepare dataset TypeError: __init__() got an unexpected keyword argument 'silent' I looked into the code in "dataloaders/planetoid_dataset.py", found the class Citeseer lacked kwargs as input in the init method. I wonder whether this is a bug. Anyway, adding kwargs solved the problem.

class Cora(Planetoid):
    def __init__(self, **kwargs):
        super(Cora, self).__init__(**kwargs)

    @classmethod
    def weighted(cls):
        return False

    @classmethod
    def directed(cls):
        return False

class CiteSeer(Planetoid):
    def __init__(self):
        super(CiteSeer, self).__init__()

    @classmethod
    def weighted(cls):
        return False

    @classmethod
    def directed(cls):
        return False 

Felicialalala avatar Sep 08 '22 08:09 Felicialalala