2021年4月21日星期三

tensorflow error

 https://github.com/tensorflow/tensorflow/issues/35403#


using a tf.Tensor as a Python bool is not allowed in Graph execution. Use Eager execution or decorate this function with 


I solve it by just using Can you please try with !pip install tensorflow-gpu==2.1-rc2and see if the error still persists. I am not seeing any issue with TF 2.1.Thanks!

2021年4月19日星期一

compiling netflow

 Have some problem on compiling netflow, so I think the error resulted by 


https://stackoverflow.com/questions/10727568/cannot-convert-parameter-1-from-const-char-to-lpcwstr


n your project, it sounds like all of these macros are referencing the -W versions. This is controlled by the UNICODE preprocessor macro (which is defined if you choose the "Use Unicode Character Set" project option in Visual Studio). (Some of Microsoft's C and C++ run time library functions also have ANSI and wide versions. Which one you get is selected by the similarly-named _UNICODE macro that is also defined by that Visual Studio project setting.)

Typically, both of the -A and -W functions exist in the libraries and are available, even if your application is compiled for Unicode. (There are exceptions; some newer functions are available only in "wide" versions.)

If you have a char * that contains text in the proper ANSI code page, you can call the -A version explicitly (e.g., SetWindowTextA). The -A versions are typically wrappers that make wide character copies of the string parameters and pass control to the -W versions.

An alternative is to make your own wide character copies of the strings. You can do this with MultiByteToWideChar. Calling it can be tricky, because you have to manage the buffers. If you can get away with calling the -A version directly, that's generally simpler and already tested. But if your char * string is using UTF-8 or any encoding other than the user's current ANSI code page, you should do the conversion yourself


change Unicode fixed the problem 

2021年4月15日星期四

tensorflow issue

 stuck in tensorflow for few days for PINN. 

One of thing to get rid of placeholder is upgrade tensorflow

import tensorflow.compat.v1 as tf

tf.disable_v2_behavior() 

#tf.compat.v1.disable_eager_execution()



https://stackoverflow.com/questions/55870127/module-tensorflow-has-no-attribute-contrib


https://stackoverflow.com/questions/30429491/how-to-use-cmakedefine-preprocessor-directive-properly


cannot find header, need to make first 


find to fix the rendering error when install vtk  add word like const

https://stackoverflow.com/questions/19816139/expression-having-type-const-comparevptrs-would-lose-some-const-volatile-quali


stop at here 

File "C:\Users\Chiwei\Anaconda3\lib\site-packages\tensorflow\python\framework\ops.py", line 481, in _disallow_in_graph_mode

    " this function with @tf.function.".format(task))


OperatorNotAllowedInGraphError: using a `tf.Tensor` as a Python `bool` is not allowed in Graph execution. Use Eager execution or decorate this function with @tf.function.


suspect is the save function and gpu plot will come back later.



2021年3月3日星期三

editing mesh in comsol

 hahahahaha I finally solve the problem in COMSOL myself. all these damn things come from the physics induced sequence.


next time cannot converge the model., right click mesh edit the physics induced sequence, then set the minimum order to be smaller then you can solve any model. 


https://www.comsol.com/forum/thread/53241/ivar-kjelberg-problem-on-joule-heating-analysis-over-a-thin-geometry


Ivar kjelberg after so many years you are still the best mentor on the forum. thanks for tips. 

2020年6月7日星期日

matlab ubuntu remote control and python2 to python3

Today manage to using remote control on the ubuntu

1. you can turn on the screen sharing using privary setting and ask it to just use the password,
then you can on remina from virtual ubuntu to remote access it
or you can also use windows
instal the vnc viewer
https://www.howtogeek.com/429190/how-to-set-up-remote-desktop-on-ubuntu/

2. also I manage to install matlab on ubuntu
https://linuxconfig.org/how-to-install-matlab-on-ubuntu-18-04-bionic-beaver-linux

3.         try:
            val_local = w.vector()(val_dof[0])

from dolfin import *
from ufl import cofac
import dolfin as dolfin
import sys

import
from ufl import cofac

mesh = Mesh()
f = HDF5File(MPI.comm_world, meshname+".hdf5", 'r')

print(tstep, p_cav*0.0075 , V_cav, fdataPV)

use 2to3 convert print function from python2 to python3
sudo apt-get 2to3

mesh = Mesh()
f = HDF5File(MPI.comm_world, meshname+".hdf5", 'r')

2020年3月23日星期一

A farewell for what-if

did not expect I am going to have my last paper to publish before I go to industry so soon.
I like research, however if I cannot get the Newton fellowship to go Imperial college, then I guess, this is going to be my last chance to do research in postdoc.

Thanks Prof yap for helping me throughout the fellowship application.

Thanks lik chuan and his team to support me unconditionally.

too many people I want to say thanks, but just to say sorry, as I have to let you down this time, as I am preparing to leave already if I dont get it.

Thank you very much NUS for every memory you give me. I am grateful for the past five years you give me. I am thinking if I got the fellowship, I will have another round to stay in research, but ya, my family need money, so I guess there is no turning back and I have to go d.

Thank you so much for the research world and wish all the best for the biomechanics journey.

I will be going to miss your guys very much.

enjoy guys!

2019年5月30日星期四

error for gcloud permission

I recently has problem on uploading the file to gcloud services, so the solution is suggested as below

is add the username@ instances name

that solve the problem