Closed AndreaPi closed 2 weeks ago
@Alexey-Kamenev could you please take a look?
You are correct, BSMS MGN expects the data in a certain format. To enable this format, you need to wrap your dataset class in BistrideMultiLayerGraphDataset
like it's done in the Ahmed body example. You can do this either in the code or by using Hydra config - check out the BSMS Ahmed body experiment and corresponding dataset config.
I'm not sure I understand. Do you mean that, if I want to test both MeshGraphNet and BSMS MGN on the same data, I need to write two different dataset classes? That's not great from a SWE point of view - I'd like my dataset class to be independent of the model class, as much as possible. Of course, complete decoupling is not realistic (if I want to test a set of GNN models, I expect the Dataset class to have a graph building method), but having to write a different class for each model I want to test is definitely suboptimal. Maybe I didn't understand your suggestion?
You don't need to write a new dataset class, all you have to do is to wrap your existing dataset class with BistrideMultiLayerGraphDataset
class, like it's demonstrated in the config I mentioned in my response.
Specifically, in that config example, the already existing Ahmed Body dataset class, AhmedBodyDataset
, is wrapped by BistrideMultiLayerGraphDataset
. So in your case, all you have to do is provide your own, already existing, class instead of AhmedBodyDataset
.
If you prefer doing it from the code rather than Hydra config, then the code will roughly look something like:
dataset = MyDataset(...)
if use_bsms:
dataset = BistrideMultiLayerGraphDataset(dataset, num_layers=2, cache_dir="/data/bsms_l2_cache")
There is a concrete example in one of our unit tests here.
Closing the issue. Feel free to re-open or create a new one, if needed.
Version
0.8.0
On which installation method(s) does this occur?
Docker
Describe the issue
I'm trying to train a BiStride MeshGraphNet on my dataset (very similar to DrivAerNet), but I keep getting errors. It looks like it's expecting the data in the graph to have a very specific structure, unlike MeshGraphNet which is better written (and it trains on my data). The error I'm getting is
Can you help? It would be useful if you provided an example to test BiStride MeshGraphNet out, but the only example mentioned in the documentation regards the Ahmed body dataset which is not included in the
examples
folder. https://docs.nvidia.com/deeplearning/modulus/modulus-core/examples/cfd/aero_graph_net/readme.html#bsms-mgn-trainingMinimum reproducible example
This is the dataset class:
And this is the
__init__
method of my trainer class:Relevant log output
No response
Environment details
No response