Closed kaad01 closed 1 year ago
@jmsfltchr Could you assign someone to help?
@kaad01 James is no longer with the team. @flyingsilverfin can you help?
@kaad01 James is no longer with the team. @flyingsilverfin can you help?
Thank you for your answer. I fixed it. There was a case where not every relation is in the database. So the writer gets an empty tensor you should just check if the tensor is empty with .numel()
for edge_type, edge_store in zip(data.edge_types, data.edge_stores):
if edge_store["edge_attr"].numel():
writer.add_histogram('('+', '.join(edge_type) + ')/edge_attr', edge_store["edge_attr"])
writer.add_histogram('('+', '.join(edge_type) + ')/y_edge', edge_store["y_edge"])
for node_type, node_store in zip(data.node_types, data.node_stores):
if node_store["x"].numel():
writer.add_histogram(node_type + '/x', node_store["x"])
Description
I can not run the example diagnosis without any problems. There had to be a lot of fixing on my part. Maybe it is an environment problem, but there are still some things you should consider looking over. I will go in steps and show you how I fixed them. I can not go further then step 3. I need your help there.
1. load_typeql_file()
Reproducible Steps Starting the program with:
python3.9 -m examples.diagnosis.diagnosis "D:\UNI\Master\Masterarbeit\typedb-all-windows-2.14.2\typedb.bat"
Output gives me a FileNotFoundError:
Expected Output The line
load_typeql_file(typedb_binary_directory, database, schema_file_path, FileType.Schema)
should load the schema of the example and do a transaction with it. The same problem comes up with the data (next line).My Fix I just loaded the schema and data manually and commented the following lines out to continue the program: in diagnosis.py
2. generate_example_data()
This can work sometimes, but sometimes it does not. The problem comes with these lines: in generate.py
We want to insert querys about persons and there diagnosis. But sometimes the program just inserts the persons without matching and inserting the relations. Although the written querys are right.
My Fix
This fixes the before mentioned problem, but is not as elegant as before because we have far more transactions and commits then before. If the program goes trough to this point, you should have a database that should look like this:
For now I leave it at this.
3. writer.add_histogram()
If the above problem is fixed the program goes through till this happens:
This comes up, because in line 224 in diagnosis.py the edge_store["edge_attr"] sometimes is empty:
This is the case because the query does not give a value back:
The program does not handle this exception. Here I am stuck right now. I hope someone can help me.
Environment