@@ -449,7 +449,7 @@ def test_export_coreml(self):
449
449
import coremltools
450
450
import platform
451
451
452
- filename = tempfile .mkstemp ( "bingo .mlmodel" )[ 1 ]
452
+ filename = tempfile .NamedTemporaryFile ( suffix = " .mlmodel" ). name
453
453
self .model .export_coreml (filename , include_non_maximum_suppression = False )
454
454
455
455
coreml_model = coremltools .models .MLModel (filename )
@@ -486,7 +486,7 @@ def test_export_coreml(self):
486
486
# not that meaningful unless the model has converged
487
487
488
488
# Also check if we can train a second model and export it.
489
- filename2 = tempfile .mkstemp ( "bingo2 .mlmodel" )[ 1 ]
489
+ filename2 = tempfile .NamedTemporaryFile ( suffix = " .mlmodel" ). name
490
490
# We also test at the same time if we can export a model with a single
491
491
# class
492
492
sf = tc .SFrame (
@@ -505,7 +505,7 @@ def test_export_coreml(self):
505
505
def test_export_coreml_with_non_maximum_suppression (self ):
506
506
from PIL import Image
507
507
508
- filename = tempfile .mkstemp ( "bingo .mlmodel" )[ 1 ]
508
+ filename = tempfile .NamedTemporaryFile ( suffix = " .mlmodel" ). name
509
509
self .model .export_coreml (filename , include_non_maximum_suppression = True )
510
510
511
511
coreml_model = coremltools .models .MLModel (filename )
@@ -521,7 +521,7 @@ def test_export_coreml_with_non_maximum_suppression(self):
521
521
# not that meaningful unless the model has converged
522
522
523
523
# Also check if we can train a second model and export it.
524
- filename2 = tempfile .mkstemp ( "bingo2 .mlmodel" )[ 1 ]
524
+ filename2 = tempfile .NamedTemporaryFile ( suffix = " .mlmodel" ). name
525
525
# We also test at the same time if we can export a model with a single
526
526
# class
527
527
sf = tc .SFrame (
0 commit comments