Skip to content

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

@Felicialalala

Description

@Felicialalala

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 

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions