0

I'm very new to git and GitHub, and I'm trying to include a repository from GitHub to learn some basics of Graph Convolutional Neural Network. I have used "git init" to initialize the folder on my PC and used git submodule add https://github.com/vermaMachineLearning/keras-deep-graph-learning.git to add the repository as a subfolder, but when I tried to import the package using the following code

import os, sys
sys.path.append(os.path.join(os.getcwd(), "keras-deep-graph-learning")) # Adding the submodule to the module search path
sys.path.append(os.path.join(os.getcwd(), "keras-deep-graph-learning/examples")) # Adding the submodule to the module search path
import numpy as np
from keras.layers import Dense, Activation, Dropout
from keras.models import Model, Sequential
from keras.regularizers import l2
from tensorflow.keras.optimizers import Adam
from keras_dgl.layers import GraphCNN
import keras.backend as K
from keras.utils import to_categorical

It will give me the following trackback.

ModuleNotFoundError                       Traceback (most recent call last)
~\AppData\Local\Temp/ipykernel_22224/914478576.py in <module>
      7 from keras.regularizers import l2
      8 from tensorflow.keras.optimizers import Adam
----> 9 from keras_dgl.layers import GraphCNN
     10 import keras.backend as K
     11 from keras.utils import to_categorical

~\python\GNN\keras-deep-graph-learning\keras_dgl\layers\__init__.py in <module>
----> 1 from .graph_cnn_layer import GraphCNN
      2 from .multi_graph_cnn_layer import MultiGraphCNN
      3 from .graph_attention_cnn_layer import GraphAttentionCNN
      4 from .multi_graph_attention_cnn_layer import MultiGraphAttentionCNN
      5 from .graph_convolutional_recurrent_layer import GraphConvLSTM

~\python\GNN\keras-deep-graph-learning\keras_dgl\layers\graph_cnn_layer.py in <module>
      2 from keras import regularizers
      3 import keras.backend as K
----> 4 from keras.engine.topology import Layer
      5 import tensorflow as tf
      6 from .graph_ops import graph_conv_op

ModuleNotFoundError: No module named 'keras.engine.topology'

My experience with deep learning and GitHub is very limited. Could anyone please kindly let me know if I made any silly mistakes? Thanks a lot for your great support and help.

user202729
  • 3,358
  • 3
  • 25
  • 36
yihao ren
  • 369
  • 1
  • 4
  • 15
  • 1
    First, there isn't enough information in the question to understand the problem without going to an external link... – user202729 Aug 19 '21 at 01:46
  • Why would the package not be pip installable? Is there any instruction on how to install it? Etc. – user202729 Aug 19 '21 at 01:46
  • It's likely that you should pip install the package rather than modifying sys.path. See[python - Configuring so that pip install can work from github - Stack Overflow](https://stackoverflow.com/questions/8247605/configuring-so-that-pip-install-can-work-from-github) – user202729 Aug 19 '21 at 01:47
  • @user202729 I tried the command in the link you provided `pip install git+https://github.com/vermaMachineLearning/keras-deep-graph-learning.git`. in anaconda prompt, but it would introduce a new error `ERROR: File "setup.py" not found for legacy project git+https://github.com/vermaMachineLearning/keras-deep-graph-learning.git.` – yihao ren Aug 19 '21 at 02:03
  • @user202729 I was trying to follow the post in the following link `https://svenbalnojan.medium.com/using-graph-cnns-in-keras-8b9f685c4ed0`. I'm sorry for the unclear question and limited experience with Github. Any help would be greatly appreciated. – yihao ren Aug 19 '21 at 02:13

0 Answers0