I want to calculate the young modulus from the stress-strain curve but it's not linear. so I should calculate the average of the slope or the maximum slope of this part?
Depending on the nature of your material, elastic behavior could be different. Also, make sure that your specimen does not have any sort of buckling, so that the initial strains are not consumed to straighten the specimen. Normally, you can measure Young modulus around 3 % strain.