Solving 3d Transient heat equation for arc welding #1459
Unanswered
Jagadeesh-23
asked this question in
Q&A
Replies: 2 comments
-
|
@lululxvi dear sir, please help me with this, this is very important for my thesis study |
Beta Was this translation helpful? Give feedback.
0 replies
-
|
You must compile the model before training. Change to And I'm assuming the size of the input layer should be 4, not 3: |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
import deepxde as dde
import matplotlib.pyplot as plt
import numpy as np
from deepxde.backend import tf
def main():
rhoc =4.005*(10**(-3))
k= 0.05
v= 10
ff= 0.6
fr= 1.4
Q= 1652.4
af= 1.002
ar= 3.34
b= 1.67
c= 1.67
h= 20*(10**(-6))
alpha= 12.484
T_ref= 273.15
Rboltz =5.67*(10**(-14))
emiss= 0.3
t0 = 0.0
te= 2.0
eta= 0.9
v = 10.
U= 15.3
I= 120
x0 =10
y0 = 0
z0 =5
Ta= 273.15
Define the boundary conditions
if name == 'main':
main()
AttributeError Traceback (most recent call last)
Cell In[2], line 156
153 dde.saveplot(losshistory, trainstate, issave=True, isplot=True)
155 if name == 'main':
--> 156 main()
Cell In[2], line 143, in main()
140 model.sess.run(tf.compat.v1.global_variables_initializer())
142 # Train the model
--> 143 model.train(epochs=30000)
144 checker = dde.callbacks.ModelCheckpoint(
145 "model/model1.ckpt", save_better_only=True, period=1000
146 )
147 losshistory, trainstate = model.train(epochs=epochs,batch_size = batch_size_,callbacks = [checker])
File /opt/conda/lib/python3.10/site-packages/deepxde/utils/internal.py:22, in timing..wrapper(*args, **kwargs)
19 @wraps(f)
20 def wrapper(*args, **kwargs):
21 ts = timeit.default_timer()
---> 22 result = f(*args, **kwargs)
23 te = timeit.default_timer()
24 if config.rank == 0:
File /opt/conda/lib/python3.10/site-packages/deepxde/model.py:622, in Model.train(self, iterations, batch_size, display_every, disregard_previous_best, callbacks, model_restore_path, model_save_path, epochs)
620 self.train_state.set_data_train(*self.data.train_next_batch(self.batch_size))
621 self.train_state.set_data_test(*self.data.test())
--> 622 self._test()
623 self.callbacks.on_train_begin()
624 if optimizers.is_external_optimizer(self.opt_name):
File /opt/conda/lib/python3.10/site-packages/deepxde/model.py:811, in Model._test(self)
806 def _test(self):
807 # TODO Now only print the training loss in rank 0. The correct way is to print the average training loss of all ranks.
808 (
809 self.train_state.y_pred_train,
810 self.train_state.loss_train,
--> 811 ) = self._outputs_losses(
812 True,
813 self.train_state.X_train,
814 self.train_state.y_train,
815 self.train_state.train_aux_vars,
816 )
817 self.train_state.y_pred_test, self.train_state.loss_test = self._outputs_losses(
818 False,
819 self.train_state.X_test,
820 self.train_state.y_test,
821 self.train_state.test_aux_vars,
822 )
824 if isinstance(self.train_state.y_test, (list, tuple)):
File /opt/conda/lib/python3.10/site-packages/deepxde/model.py:526, in Model._outputs_losses(self, training, inputs, targets, auxiliary_vars)
524 outputs_losses = self.outputs_losses_test
525 if backend_name == "tensorflow.compat.v1":
--> 526 feed_dict = self.net.feed_dict(training, inputs, targets, auxiliary_vars)
527 return self.sess.run(outputs_losses, feed_dict=feed_dict)
528 if backend_name == "tensorflow":
File /opt/conda/lib/python3.10/site-packages/deepxde/nn/tensorflow_compat_v1/nn.py:48, in NN.feed_dict(self, training, inputs, targets, auxiliary_vars)
46 """Construct a feed_dict to feed values to TensorFlow placeholders."""
47 feed_dict = {self.training: training}
---> 48 feed_dict.update(self._feed_dict_inputs(inputs))
49 if targets is not None:
50 feed_dict.update(self._feed_dict_targets(targets))
File /opt/conda/lib/python3.10/site-packages/deepxde/nn/tensorflow_compat_v1/nn.py:56, in NN._feed_dict_inputs(self, inputs)
55 def _feed_dict_inputs(self, inputs):
---> 56 return make_dict(self.inputs, inputs)
File /opt/conda/lib/python3.10/site-packages/deepxde/nn/tensorflow_compat_v1/fnn.py:47, in FNN.inputs(self)
45 @Property
46 def inputs(self):
---> 47 return self.x
AttributeError: 'FNN' object has no attribute 'x'
I dont know why i am getting this error and Please help to resolve it
Beta Was this translation helpful? Give feedback.
All reactions